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

Collapse All | Expand All

(-)sys/kern/uipc_debug.c (-3 / +4 lines)
Lines 1-5 Link Here
1
/*-
1
/*-
2
 * Copyright (c) 2007 Robert N. M. Watson
2
 * Copyright (c) 2007 Robert N. M. Watson
3
 * Copyright (c) 2015 2ch.net.
3
 * All rights reserved.
4
 * All rights reserved.
4
 *
5
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * Redistribution and use in source and binary forms, with or without
Lines 461-469 Link Here
461
462
462
	db_print_indent(indent);
463
	db_print_indent(indent);
463
	/* so_list skipped */
464
	/* so_list skipped */
464
	db_printf("so_qlen: %d   ", so->so_qlen);
465
	db_printf("so_qlen: %u   ", so->so_qlen);
465
	db_printf("so_incqlen: %d   ", so->so_incqlen);
466
	db_printf("so_incqlen: %u   ", so->so_incqlen);
466
	db_printf("so_qlimit: %d   ", so->so_qlimit);
467
	db_printf("so_qlimit: %u   ", so->so_qlimit);
467
	db_printf("so_timeo: %d   ", so->so_timeo);
468
	db_printf("so_timeo: %d   ", so->so_timeo);
468
	db_printf("so_error: %d\n", so->so_error);
469
	db_printf("so_error: %d\n", so->so_error);
469
470
(-)sys/kern/uipc_socket.c (-2 / +9 lines)
Lines 3-8 Link Here
3
 *	The Regents of the University of California.
3
 *	The Regents of the University of California.
4
 * Copyright (c) 2004 The FreeBSD Foundation
4
 * Copyright (c) 2004 The FreeBSD Foundation
5
 * Copyright (c) 2004-2008 Robert N. M. Watson
5
 * Copyright (c) 2004-2008 Robert N. M. Watson
6
 * Copyright (c) 2015 2ch.net
6
 * All rights reserved.
7
 * All rights reserved.
7
 *
8
 *
8
 * Redistribution and use in source and binary forms, with or without
9
 * Redistribution and use in source and binary forms, with or without
Lines 196-202 Link Here
196
 * NB: The orginal sysctl somaxconn is still available but hidden
197
 * NB: The orginal sysctl somaxconn is still available but hidden
197
 * to prevent confusion about the actual purpose of this number.
198
 * to prevent confusion about the actual purpose of this number.
198
 */
199
 */
199
static int somaxconn = SOMAXCONN;
200
static u_int somaxconn = SOMAXCONN;
200
201
201
static int
202
static int
202
sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
203
sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
Lines 209-215 Link Here
209
	if (error || !req->newptr )
210
	if (error || !req->newptr )
210
		return (error);
211
		return (error);
211
212
212
	if (val < 1 || val > USHRT_MAX)
213
	/*
214
	 * The purpose of the UINT_MAX / 3 limit, is so that the formula
215
	 *   3 * so_qlimit / 2
216
	 * below, will not overflow.
217
         */
218
219
	if (val < 1 || val > UINT_MAX / 3)
213
		return (EINVAL);
220
		return (EINVAL);
214
221
215
	somaxconn = val;
222
	somaxconn = val;
(-)sys/netinet/sctp_uio.h (-2 / +3 lines)
Lines 2-7 Link Here
2
 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
2
 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3
 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
3
 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4
 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
4
 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
5
 * Copyright (c) 2015, by 2ch.net. All rights reserved.
5
 *
6
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions are met:
8
 * modification, are permitted provided that the following conditions are met:
Lines 1163-1170 Link Here
1163
	uint32_t total_nospaces;
1164
	uint32_t total_nospaces;
1164
	uint32_t fragmentation_point;
1165
	uint32_t fragmentation_point;
1165
	uint16_t local_port;
1166
	uint16_t local_port;
1166
	uint16_t qlen;
1167
	uint32_t qlen;
1167
	uint16_t maxqlen;
1168
	uint32_t maxqlen;
1168
	void *socket;
1169
	void *socket;
1169
#if defined(__LP64__)
1170
#if defined(__LP64__)
1170
	uint32_t extra_padding[29];	/* future */
1171
	uint32_t extra_padding[29];	/* future */
(-)sys/sys/socketvar.h (-6 / +7 lines)
Lines 1-6 Link Here
1
/*-
1
/*-
2
 * Copyright (c) 1982, 1986, 1990, 1993
2
 * Copyright (c) 1982, 1986, 1990, 1993
3
 *	The Regents of the University of California.  All rights reserved.
3
 *	The Regents of the University of California.  All rights reserved.
4
 * Copyright (c) 2015, by 2ch.net.  All rights reserved.
4
 *
5
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * modification, are permitted provided that the following conditions
Lines 95-104 Link Here
95
	TAILQ_HEAD(, socket) so_incomp;	/* (e) queue of partial unaccepted connections */
96
	TAILQ_HEAD(, socket) so_incomp;	/* (e) queue of partial unaccepted connections */
96
	TAILQ_HEAD(, socket) so_comp;	/* (e) queue of complete unaccepted connections */
97
	TAILQ_HEAD(, socket) so_comp;	/* (e) queue of complete unaccepted connections */
97
	TAILQ_ENTRY(socket) so_list;	/* (e) list of unaccepted connections */
98
	TAILQ_ENTRY(socket) so_list;	/* (e) list of unaccepted connections */
98
	u_short	so_qlen;		/* (e) number of unaccepted connections */
99
	u_int	so_qlen;		/* (e) number of unaccepted connections */
99
	u_short	so_incqlen;		/* (e) number of unaccepted incomplete
100
	u_int	so_incqlen;		/* (e) number of unaccepted incomplete
100
					   connections */
101
					   connections */
101
	u_short	so_qlimit;		/* (e) max number queued connections */
102
	u_int	so_qlimit;		/* (e) max number queued connections */
102
	short	so_timeo;		/* (g) connection timeout */
103
	short	so_timeo;		/* (g) connection timeout */
103
	u_short	so_error;		/* (f) error affecting connection */
104
	u_short	so_error;		/* (f) error affecting connection */
104
	struct	sigio *so_sigio;	/* [sg] information for async I/O or
105
	struct	sigio *so_sigio;	/* [sg] information for async I/O or
Lines 172-180 Link Here
172
	caddr_t	so_pcb;		/* another convenient handle */
173
	caddr_t	so_pcb;		/* another convenient handle */
173
	int	xso_protocol;
174
	int	xso_protocol;
174
	int	xso_family;
175
	int	xso_family;
175
	u_short	so_qlen;
176
	u_int	so_qlen;
176
	u_short	so_incqlen;
177
	u_int	so_incqlen;
177
	u_short	so_qlimit;
178
	u_int	so_qlimit;
178
	short	so_timeo;
179
	short	so_timeo;
179
	u_short	so_error;
180
	u_short	so_error;
180
	pid_t	so_pgid;
181
	pid_t	so_pgid;
(-)usr.bin/netstat/inet.c (-3 / +4 lines)
Lines 1-6 Link Here
1
/*-
1
/*-
2
 * Copyright (c) 1983, 1988, 1993, 1995
2
 * Copyright (c) 1983, 1988, 1993, 1995
3
 *	The Regents of the University of California.  All rights reserved.
3
 *	The Regents of the University of California.  All rights reserved.
4
 * Copyright (c) 2015 2ch.net.  All rights reserved.
4
 *
5
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * modification, are permitted provided that the following conditions
Lines 479-489 Link Here
479
		else
480
		else
480
			xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar);
481
			xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar);
481
		if (Lflag) {
482
		if (Lflag) {
482
			char buf1[15];
483
			char buf1[33];
483
484
484
			snprintf(buf1, 15, "%d/%d/%d", so->so_qlen,
485
			snprintf(buf1, sizeof buf1, "%u/%u/%u", so->so_qlen,
485
			    so->so_incqlen, so->so_qlimit);
486
			    so->so_incqlen, so->so_qlimit);
486
			xo_emit("{:listen-queue-sizes/%-14.14s} ", buf1);
487
			xo_emit("{:listen-queue-sizes/%-32.32s} ", buf1);
487
		} else if (Tflag) {
488
		} else if (Tflag) {
488
			if (istcp)
489
			if (istcp)
489
				xo_emit("{:sent-retransmit-packets/%6u} "
490
				xo_emit("{:sent-retransmit-packets/%6u} "
(-)usr.bin/netstat/sctp.c (-2 / +4 lines)
Lines 1-6 Link Here
1
/*-
1
/*-
2
 * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved.
2
 * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved.
3
 * Copyright (c) 2011, by Michael Tuexen. All rights reserved.
3
 * Copyright (c) 2011, by Michael Tuexen. All rights reserved.
4
 * Copyright (c) 2015, by 2ch.net. All rights reserved.
4
 *
5
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 * modification, are permitted provided that the following conditions are met:
Lines 467-475 Link Here
467
		tname = "????";
468
		tname = "????";
468
469
469
	if (Lflag) {
470
	if (Lflag) {
470
		char buf1[9];
471
		char buf1[22];
471
472
472
		snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen);
473
		snprintf(buf1, sizeof buf1, "%u/%u", 
474
		    xinpcb->qlen, xinpcb->maxqlen);
473
		xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
475
		xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
474
		    pname, tname);
476
		    pname, tname);
475
		xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}"
477
		xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}"
(-)usr.bin/netstat/unix.c (-4 / +5 lines)
Lines 1-6 Link Here
1
/*-
1
/*-
2
 * Copyright (c) 1983, 1988, 1993
2
 * Copyright (c) 1983, 1988, 1993
3
 *	The Regents of the University of California.  All rights reserved.
3
 *	The Regents of the University of California.  All rights reserved.
4
 * Copyright (c) 2015 2ch.net.  All rights reserved.
4
 *
5
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * modification, are permitted provided that the following conditions
Lines 271-277 Link Here
271
	struct unpcb *unp;
272
	struct unpcb *unp;
272
	struct sockaddr_un *sa;
273
	struct sockaddr_un *sa;
273
	static int first = 1;
274
	static int first = 1;
274
	char buf1[15];
275
	char buf1[33];
275
	static const char *titles[2] = {
276
	static const char *titles[2] = {
276
	    "{T:/%-8.8s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%8.8s} "
277
	    "{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",
278
	    "{T:/%8.8s} {T:/%8.8s} {T:/%8.8s} {T:Addr}\n",
Lines 310-319 Link Here
310
		return;
311
		return;
311
312
312
	if (Lflag) {
313
	if (Lflag) {
313
		snprintf(buf1, 15, "%d/%d/%d", so->so_qlen,
314
		snprintf(buf1, sizeof buf1, "%u/%u/%u", so->so_qlen,
314
		    so->so_incqlen, so->so_qlimit);
315
		    so->so_incqlen, so->so_qlimit);
315
		xo_emit("unix  {d:socket/%-14.14s}{e:queue-length/%d}"
316
		xo_emit("unix  {d:socket/%-32.32s}{e:queue-length/%u}"
316
		    "{e:incomplete-queue-length/%d}{e:queue-limit/%d}",
317
		    "{e:incomplete-queue-length/%u}{e:queue-limit/%u}",
317
		    buf1, so->so_qlen, so->so_incqlen, so->so_qlimit);
318
		    buf1, so->so_qlen, so->so_incqlen, so->so_qlimit);
318
	} else {
319
	} else {
319
		xo_emit(format[fmt],
320
		xo_emit(format[fmt],

Return to bug 203922