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

Collapse All | Expand All

(-)sys/kern/uipc_debug.c (-3 / +3 lines)
Lines 461-469 Link Here
461
461
462
	db_print_indent(indent);
462
	db_print_indent(indent);
463
	/* so_list skipped */
463
	/* so_list skipped */
464
	db_printf("so_qlen: %d   ", so->so_qlen);
464
	db_printf("so_qlen: %u   ", so->so_qlen);
465
	db_printf("so_incqlen: %d   ", so->so_incqlen);
465
	db_printf("so_incqlen: %u   ", so->so_incqlen);
466
	db_printf("so_qlimit: %d   ", so->so_qlimit);
466
	db_printf("so_qlimit: %u   ", so->so_qlimit);
467
	db_printf("so_timeo: %d   ", so->so_timeo);
467
	db_printf("so_timeo: %d   ", so->so_timeo);
468
	db_printf("so_error: %d\n", so->so_error);
468
	db_printf("so_error: %d\n", so->so_error);
469
469
(-)sys/kern/uipc_socket.c (-2 / +8 lines)
Lines 196-202 Link Here
196
 * NB: The orginal sysctl somaxconn is still available but hidden
196
 * NB: The orginal sysctl somaxconn is still available but hidden
197
 * to prevent confusion about the actual purpose of this number.
197
 * to prevent confusion about the actual purpose of this number.
198
 */
198
 */
199
static int somaxconn = SOMAXCONN;
199
static u_int somaxconn = SOMAXCONN;
200
200
201
static int
201
static int
202
sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
202
sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
Lines 209-215 Link Here
209
	if (error || !req->newptr )
209
	if (error || !req->newptr )
210
		return (error);
210
		return (error);
211
211
212
	if (val < 1 || val > USHRT_MAX)
212
	/*
213
	 * The purpose of the UINT_MAX / 3 limit, is so that the formula
214
	 *   3 * so_qlimit / 2
215
	 * below, will not overflow.
216
         */
217
218
	if (val < 1 || val > UINT_MAX / 3)
213
		return (EINVAL);
219
		return (EINVAL);
214
220
215
	somaxconn = val;
221
	somaxconn = val;
(-)sys/netinet/sctp_sysctl.c (+4 lines)
Lines 426-432 Link Here
426
			xinpcb.maxqlen = 0;
426
			xinpcb.maxqlen = 0;
427
		} else {
427
		} else {
428
			xinpcb.qlen = so->so_qlen;
428
			xinpcb.qlen = so->so_qlen;
429
			xinpcb.qlen_old = so->so_qlen > USHRT_MAX ? 
430
				USHRT_MAX : (uint16_t) so->so_qlen;
429
			xinpcb.maxqlen = so->so_qlimit;
431
			xinpcb.maxqlen = so->so_qlimit;
432
			xinpcb.maxqlen_old = so->so_qlimit > USHRT_MAX ? 
433
				USHRT_MAX : (uint16_t) so->so_qlimit;
430
		}
434
		}
431
		SCTP_INP_INCR_REF(inp);
435
		SCTP_INP_INCR_REF(inp);
432
		SCTP_INP_RUNLOCK(inp);
436
		SCTP_INP_RUNLOCK(inp);
(-)sys/netinet/sctp_uio.h (-4 / +6 lines)
Lines 1170-1182 Link Here
1170
	uint32_t total_nospaces;
1170
	uint32_t total_nospaces;
1171
	uint32_t fragmentation_point;
1171
	uint32_t fragmentation_point;
1172
	uint16_t local_port;
1172
	uint16_t local_port;
1173
	uint16_t qlen;
1173
	uint16_t qlen_old;
1174
	uint16_t maxqlen;
1174
	uint16_t maxqlen_old;
1175
	void *socket;
1175
	void *socket;
1176
	uint32_t qlen;
1177
	uint32_t maxqlen;
1176
#if defined(__LP64__)
1178
#if defined(__LP64__)
1177
	uint32_t extra_padding[29];	/* future */
1179
	uint32_t extra_padding[27];	/* future */
1178
#else
1180
#else
1179
	uint32_t extra_padding[30];	/* future */
1181
	uint32_t extra_padding[28];	/* future */
1180
#endif
1182
#endif
1181
};
1183
};
1182
1184
(-)sys/sys/socketvar.h (-6 / +6 lines)
Lines 95-104 Link Here
95
	TAILQ_HEAD(, socket) so_incomp;	/* (e) queue of partial unaccepted connections */
95
	TAILQ_HEAD(, socket) so_incomp;	/* (e) queue of partial unaccepted connections */
96
	TAILQ_HEAD(, socket) so_comp;	/* (e) queue of complete unaccepted connections */
96
	TAILQ_HEAD(, socket) so_comp;	/* (e) queue of complete unaccepted connections */
97
	TAILQ_ENTRY(socket) so_list;	/* (e) list of unaccepted connections */
97
	TAILQ_ENTRY(socket) so_list;	/* (e) list of unaccepted connections */
98
	u_short	so_qlen;		/* (e) number of unaccepted connections */
98
	u_int	so_qlen;		/* (e) number of unaccepted connections */
99
	u_short	so_incqlen;		/* (e) number of unaccepted incomplete
99
	u_int	so_incqlen;		/* (e) number of unaccepted incomplete
100
					   connections */
100
					   connections */
101
	u_short	so_qlimit;		/* (e) max number queued connections */
101
	u_int	so_qlimit;		/* (e) max number queued connections */
102
	short	so_timeo;		/* (g) connection timeout */
102
	short	so_timeo;		/* (g) connection timeout */
103
	u_short	so_error;		/* (f) error affecting connection */
103
	u_short	so_error;		/* (f) error affecting connection */
104
	struct	sigio *so_sigio;	/* [sg] information for async I/O or
104
	struct	sigio *so_sigio;	/* [sg] information for async I/O or
Lines 172-180 Link Here
172
	caddr_t	so_pcb;		/* another convenient handle */
172
	caddr_t	so_pcb;		/* another convenient handle */
173
	int	xso_protocol;
173
	int	xso_protocol;
174
	int	xso_family;
174
	int	xso_family;
175
	u_short	so_qlen;
175
	u_int	so_qlen;
176
	u_short	so_incqlen;
176
	u_int	so_incqlen;
177
	u_short	so_qlimit;
177
	u_int	so_qlimit;
178
	short	so_timeo;
178
	short	so_timeo;
179
	u_short	so_error;
179
	u_short	so_error;
180
	pid_t	so_pgid;
180
	pid_t	so_pgid;
(-)usr.bin/netstat/inet.c (-3 / +3 lines)
Lines 486-496 Link Here
486
		else
486
		else
487
			xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar);
487
			xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar);
488
		if (Lflag) {
488
		if (Lflag) {
489
			char buf1[15];
489
			char buf1[33];
490
490
491
			snprintf(buf1, 15, "%d/%d/%d", so->so_qlen,
491
			snprintf(buf1, sizeof buf1, "%u/%u/%u", so->so_qlen,
492
			    so->so_incqlen, so->so_qlimit);
492
			    so->so_incqlen, so->so_qlimit);
493
			xo_emit("{:listen-queue-sizes/%-14.14s} ", buf1);
493
			xo_emit("{:listen-queue-sizes/%-32.32s} ", buf1);
494
		} else if (Tflag) {
494
		} else if (Tflag) {
495
			if (istcp)
495
			if (istcp)
496
				xo_emit("{:sent-retransmit-packets/%6u} "
496
				xo_emit("{:sent-retransmit-packets/%6u} "
(-)usr.bin/netstat/sctp.c (-2 / +3 lines)
Lines 467-475 Link Here
467
		tname = "????";
467
		tname = "????";
468
468
469
	if (Lflag) {
469
	if (Lflag) {
470
		char buf1[9];
470
		char buf1[22];
471
471
472
		snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen);
472
		snprintf(buf1, sizeof buf1, "%u/%u", 
473
		    xinpcb->qlen, xinpcb->maxqlen);
473
		xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
474
		xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
474
		    pname, tname);
475
		    pname, tname);
475
		xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}"
476
		xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}"
(-)usr.bin/netstat/unix.c (-4 / +4 lines)
Lines 271-277 Link Here
271
	struct unpcb *unp;
271
	struct unpcb *unp;
272
	struct sockaddr_un *sa;
272
	struct sockaddr_un *sa;
273
	static int first = 1;
273
	static int first = 1;
274
	char buf1[15];
274
	char buf1[33];
275
	static const char *titles[2] = {
275
	static const char *titles[2] = {
276
	    "{T:/%-8.8s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%8.8s} "
276
	    "{T:/%-8.8s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%8.8s} "
277
	    "{T:/%8.8s} {T:/%8.8s} {T:/%8.8s} {T:Addr}\n",
277
	    "{T:/%8.8s} {T:/%8.8s} {T:/%8.8s} {T:Addr}\n",
Lines 310-319 Link Here
310
		return;
310
		return;
311
311
312
	if (Lflag) {
312
	if (Lflag) {
313
		snprintf(buf1, 15, "%d/%d/%d", so->so_qlen,
313
		snprintf(buf1, sizeof buf1, "%u/%u/%u", so->so_qlen,
314
		    so->so_incqlen, so->so_qlimit);
314
		    so->so_incqlen, so->so_qlimit);
315
		xo_emit("unix  {d:socket/%-14.14s}{e:queue-length/%d}"
315
		xo_emit("unix  {d:socket/%-32.32s}{e:queue-length/%u}"
316
		    "{e:incomplete-queue-length/%d}{e:queue-limit/%d}",
316
		    "{e:incomplete-queue-length/%u}{e:queue-limit/%u}",
317
		    buf1, so->so_qlen, so->so_incqlen, so->so_qlimit);
317
		    buf1, so->so_qlen, so->so_incqlen, so->so_qlimit);
318
	} else {
318
	} else {
319
		xo_emit(format[fmt],
319
		xo_emit(format[fmt],

Return to bug 203922