View | Details | Raw Unified | Return to bug 260116 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/netinet/sctp_input.c (+1 lines)
Lines 995-1000 sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, Link Here
995
		if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
995
		if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
996
		    (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
996
		    (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
997
			stcb->sctp_socket->so_snd.sb_cc = 0;
997
			stcb->sctp_socket->so_snd.sb_cc = 0;
998
			SCTP_UNIFY_SB_CC(stcb->sctp_socket->so_snd);
998
		}
999
		}
999
		sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED);
1000
		sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED);
1000
	}
1001
	}
(-)b/sys/netinet/sctp_os_bsd.h (+5 lines)
Lines 378-383 typedef struct callout sctp_os_timer_t; Link Here
378
 * with SCTP sockets.
378
 * with SCTP sockets.
379
 */
379
 */
380
#define sb_cc sb_acc
380
#define sb_cc sb_acc
381
/* Macro to unify sendbuffer counters sb_acc and sb_ccc.
382
 * Both counters are required to be set to receive correct events via
383
 * poll()/kevent() when send buffer is full on 1-to-1 style sockets.
384
 */
385
#define SCTP_UNIFY_SB_CC(sb)	(atomic_store_int(&(sb).sb_ccc, (sb).sb_acc))
381
/* reserve sb space for a socket */
386
/* reserve sb space for a socket */
382
#define SCTP_SORESERVE(so, send, recv)	soreserve(so, send, recv)
387
#define SCTP_SORESERVE(so, send, recv)	soreserve(so, send, recv)
383
/* wakeup a socket */
388
/* wakeup a socket */
(-)b/sys/netinet/sctp_output.c (+1 lines)
Lines 7258-7263 sctp_move_to_outqueue(struct sctp_tcb *stcb, Link Here
7258
			    ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
7258
			    ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
7259
			    (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) {
7259
			    (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) {
7260
				atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length);
7260
				atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length);
7261
				SCTP_UNIFY_SB_CC(stcb->sctp_socket->so_snd);
7261
			}
7262
			}
7262
			if (sp->data) {
7263
			if (sp->data) {
7263
				sctp_m_freem(sp->data);
7264
				sctp_m_freem(sp->data);
(-)b/sys/netinet/sctp_usrreq.c (+3 lines)
Lines 437-442 sctp_abort(struct socket *so) Link Here
437
		    SCTP_CALLED_AFTER_CMPSET_OFCLOSE);
437
		    SCTP_CALLED_AFTER_CMPSET_OFCLOSE);
438
		SOCK_LOCK(so);
438
		SOCK_LOCK(so);
439
		SCTP_SB_CLEAR(so->so_snd);
439
		SCTP_SB_CLEAR(so->so_snd);
440
		SCTP_UNIFY_SB_CC(so->so_snd);
440
		/*
441
		/*
441
		 * same for the rcv ones, they are only here for the
442
		 * same for the rcv ones, they are only here for the
442
		 * accounting/select.
443
		 * accounting/select.
Lines 548-553 sctp_close(struct socket *so) Link Here
548
		 */
549
		 */
549
		SOCK_LOCK(so);
550
		SOCK_LOCK(so);
550
		SCTP_SB_CLEAR(so->so_snd);
551
		SCTP_SB_CLEAR(so->so_snd);
552
		SCTP_UNIFY_SB_CC(so->so_snd);
551
		/*
553
		/*
552
		 * same for the rcv ones, they are only here for the
554
		 * same for the rcv ones, they are only here for the
553
		 * accounting/select.
555
		 * accounting/select.
Lines 838-843 sctp_flush(struct socket *so, int how) Link Here
838
		 * except maybe the count
840
		 * except maybe the count
839
		 */
841
		 */
840
		so->so_snd.sb_cc = 0;
842
		so->so_snd.sb_cc = 0;
843
		SCTP_UNIFY_SB_CC(so->so_snd);
841
		so->so_snd.sb_mbcnt = 0;
844
		so->so_snd.sb_mbcnt = 0;
842
		so->so_snd.sb_mb = NULL;
845
		so->so_snd.sb_mb = NULL;
843
	}
846
	}
(-)b/sys/netinet/sctputil.c (+1 lines)
Lines 5045-5050 sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc, Link Here
5045
		} else {
5045
		} else {
5046
			stcb->sctp_socket->so_snd.sb_cc = 0;
5046
			stcb->sctp_socket->so_snd.sb_cc = 0;
5047
		}
5047
		}
5048
		SCTP_UNIFY_SB_CC(stcb->sctp_socket->so_snd);
5048
	}
5049
	}
5049
}
5050
}
5050
5051
(-)b/sys/netinet/sctputil.h (-1 / +3 lines)
Lines 264-269 do { \ Link Here
264
			} else { \
264
			} else { \
265
				stcb->sctp_socket->so_snd.sb_cc = 0; \
265
				stcb->sctp_socket->so_snd.sb_cc = 0; \
266
			} \
266
			} \
267
			SCTP_UNIFY_SB_CC(stcb->sctp_socket->so_snd); \
267
		} \
268
		} \
268
	} \
269
	} \
269
} while (0)
270
} while (0)
Lines 285-290 do { \ Link Here
285
			} else { \
286
			} else { \
286
				stcb->sctp_socket->so_snd.sb_cc = 0; \
287
				stcb->sctp_socket->so_snd.sb_cc = 0; \
287
			} \
288
			} \
289
			SCTP_UNIFY_SB_CC(stcb->sctp_socket->so_snd); \
288
		} \
290
		} \
289
	} \
291
	} \
290
} while (0)
292
} while (0)
Lines 296-301 do { \ Link Here
296
	    ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
298
	    ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
297
	     (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
299
	     (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
298
		atomic_add_int(&stcb->sctp_socket->so_snd.sb_cc,sz); \
300
		atomic_add_int(&stcb->sctp_socket->so_snd.sb_cc,sz); \
301
		SCTP_UNIFY_SB_CC(stcb->sctp_socket->so_snd); \
299
	} \
302
	} \
300
} while (0)
303
} while (0)
301
304
302
- 

Return to bug 260116