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 (-1 / +6 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
/* Since both sb_acc and sb_ccc are used by the framework we need
382
 * to make sure the values are unified, e.g. POLL/EVFILT uses sb_ccc.
383
 */
384
#define SCTP_UNIFY_SB_CC(sb)	(atomic_store_int(&(sb)->sb_ccc, (sb)->sb_acc))
381
/* reserve sb space for a socket */
385
/* reserve sb space for a socket */
382
#define SCTP_SORESERVE(so, send, recv)	soreserve(so, send, recv)
386
#define SCTP_SORESERVE(so, send, recv)	soreserve(so, send, recv)
383
/* wakeup a socket */
387
/* wakeup a socket */
Lines 386-392 typedef struct callout sctp_os_timer_t; Link Here
386
#define SCTP_SB_CLEAR(sb)	\
390
#define SCTP_SB_CLEAR(sb)	\
387
	(sb).sb_cc = 0;		\
391
	(sb).sb_cc = 0;		\
388
	(sb).sb_mb = NULL;	\
392
	(sb).sb_mb = NULL;	\
389
	(sb).sb_mbcnt = 0;
393
	(sb).sb_mbcnt = 0;	\
394
	SCTP_UNIFY_SB_CC(&sb);
390
395
391
#define SCTP_SB_LIMIT_RCV(so) (SOLISTENING(so) ? so->sol_sbrcv_hiwat : so->so_rcv.sb_hiwat)
396
#define SCTP_SB_LIMIT_RCV(so) (SOLISTENING(so) ? so->sol_sbrcv_hiwat : so->so_rcv.sb_hiwat)
392
#define SCTP_SB_LIMIT_SND(so) (SOLISTENING(so) ? so->sol_sbsnd_hiwat : so->so_snd.sb_hiwat)
397
#define SCTP_SB_LIMIT_SND(so) (SOLISTENING(so) ? so->sol_sbsnd_hiwat : so->so_snd.sb_hiwat)
(-)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_structs.h (+1 lines)
Lines 1003-1008 struct sctp_association { Link Here
1003
	uint32_t total_output_queue_size;
1003
	uint32_t total_output_queue_size;
1004
1004
1005
	uint32_t sb_cc;		/* shadow of sb_cc */
1005
	uint32_t sb_cc;		/* shadow of sb_cc */
1006
	uint32_t sb_ccc;	/* shadow of sb_ccc */
1006
	uint32_t sb_send_resv;	/* amount reserved on a send */
1007
	uint32_t sb_send_resv;	/* amount reserved on a send */
1007
	uint32_t my_rwnd_control_len;	/* shadow of sb_mbcnt used for rwnd
1008
	uint32_t my_rwnd_control_len;	/* shadow of sb_mbcnt used for rwnd
1008
					 * control */
1009
					 * control */
(-)b/sys/netinet/sctp_usrreq.c (+1 lines)
Lines 838-843 sctp_flush(struct socket *so, int how) Link Here
838
		 * except maybe the count
838
		 * except maybe the count
839
		 */
839
		 */
840
		so->so_snd.sb_cc = 0;
840
		so->so_snd.sb_cc = 0;
841
		SCTP_UNIFY_SB_CC(&so->so_snd);
841
		so->so_snd.sb_mbcnt = 0;
842
		so->so_snd.sb_mbcnt = 0;
842
		so->so_snd.sb_mb = NULL;
843
		so->so_snd.sb_mb = NULL;
843
	}
844
	}
(-)b/sys/netinet/sctp_var.h (+4 lines)
Lines 199-207 extern struct pr_usrreqs sctp_usrreqs; Link Here
199
199
200
#define sctp_sbfree(ctl, stcb, sb, m) { \
200
#define sctp_sbfree(ctl, stcb, sb, m) { \
201
	SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_cc, SCTP_BUF_LEN((m))); \
201
	SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_cc, SCTP_BUF_LEN((m))); \
202
	SCTP_UNIFY_SB_CC(sb); \
202
	SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_mbcnt, MSIZE); \
203
	SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_mbcnt, MSIZE); \
203
	if (((ctl)->do_not_ref_stcb == 0) && stcb) {\
204
	if (((ctl)->do_not_ref_stcb == 0) && stcb) {\
204
		SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \
205
		SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \
206
		SCTP_UNIFY_SB_CC(&(stcb)->asoc);                       \
205
		SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \
207
		SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \
206
	} \
208
	} \
207
	if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \
209
	if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \
Lines 211-219 extern struct pr_usrreqs sctp_usrreqs; Link Here
211
213
212
#define sctp_sballoc(stcb, sb, m) { \
214
#define sctp_sballoc(stcb, sb, m) { \
213
	atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \
215
	atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \
216
	SCTP_UNIFY_SB_CC(sb); \
214
	atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \
217
	atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \
215
	if (stcb) { \
218
	if (stcb) { \
216
		atomic_add_int(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \
219
		atomic_add_int(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \
220
		SCTP_UNIFY_SB_CC(&(stcb)->asoc); \
217
		atomic_add_int(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \
221
		atomic_add_int(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \
218
	} \
222
	} \
219
	if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \
223
	if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \
(-)b/sys/netinet/sctputil.c (+2 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
Lines 6127-6132 sctp_sorecvmsg(struct socket *so, Link Here
6127
					if ((control->do_not_ref_stcb == 0) &&
6128
					if ((control->do_not_ref_stcb == 0) &&
6128
					    stcb) {
6129
					    stcb) {
6129
						atomic_subtract_int(&stcb->asoc.sb_cc, cp_len);
6130
						atomic_subtract_int(&stcb->asoc.sb_cc, cp_len);
6131
						SCTP_UNIFY_SB_CC(&stcb->asoc);
6130
					}
6132
					}
6131
					copied_so_far += cp_len;
6133
					copied_so_far += cp_len;
6132
					freed_so_far += (uint32_t)cp_len;
6134
					freed_so_far += (uint32_t)cp_len;
(-)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