FreeBSD Bugzilla – Attachment 162281 Details for
Bug 203922
The kern.ipc.acceptqueue limit is too low
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
A patch that changes kern.ipc.acceptqueue to unsigned integer.
kern.ipc.acceptqueue.patch (text/plain), 7.46 KB, created by
White Knight
on 2015-10-21 11:48:53 UTC
(
hide
)
Description:
A patch that changes kern.ipc.acceptqueue to unsigned integer.
Filename:
MIME Type:
Creator:
White Knight
Created:
2015-10-21 11:48:53 UTC
Size:
7.46 KB
patch
obsolete
>Index: sys/kern/uipc_debug.c >=================================================================== >--- sys/kern/uipc_debug.c (revision 289686) >+++ sys/kern/uipc_debug.c (working copy) >@@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2007 Robert N. M. Watson >+ * Copyright (c) 2015 2ch.net. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without >@@ -461,9 +462,9 @@ > > db_print_indent(indent); > /* so_list skipped */ >- db_printf("so_qlen: %d ", so->so_qlen); >- db_printf("so_incqlen: %d ", so->so_incqlen); >- db_printf("so_qlimit: %d ", so->so_qlimit); >+ db_printf("so_qlen: %u ", so->so_qlen); >+ db_printf("so_incqlen: %u ", so->so_incqlen); >+ db_printf("so_qlimit: %u ", so->so_qlimit); > db_printf("so_timeo: %d ", so->so_timeo); > db_printf("so_error: %d\n", so->so_error); > >Index: sys/kern/uipc_socket.c >=================================================================== >--- sys/kern/uipc_socket.c (revision 289686) >+++ sys/kern/uipc_socket.c (working copy) >@@ -3,6 +3,7 @@ > * The Regents of the University of California. > * Copyright (c) 2004 The FreeBSD Foundation > * Copyright (c) 2004-2008 Robert N. M. Watson >+ * Copyright (c) 2015 2ch.net > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without >@@ -196,7 +197,7 @@ > * NB: The orginal sysctl somaxconn is still available but hidden > * to prevent confusion about the actual purpose of this number. > */ >-static int somaxconn = SOMAXCONN; >+static u_int somaxconn = SOMAXCONN; > > static int > sysctl_somaxconn(SYSCTL_HANDLER_ARGS) >@@ -209,7 +210,13 @@ > if (error || !req->newptr ) > return (error); > >- if (val < 1 || val > USHRT_MAX) >+ /* >+ * The purpose of the UINT_MAX / 3 limit, is so that the formula >+ * 3 * so_qlimit / 2 >+ * below, will not overflow. >+ */ >+ >+ if (val < 1 || val > UINT_MAX / 3) > return (EINVAL); > > somaxconn = val; >Index: sys/netinet/sctp_uio.h >=================================================================== >--- sys/netinet/sctp_uio.h (revision 289686) >+++ sys/netinet/sctp_uio.h (working copy) >@@ -2,6 +2,7 @@ > * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. > * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. > * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. >+ * Copyright (c) 2015, by 2ch.net. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are met: >@@ -1163,8 +1164,8 @@ > uint32_t total_nospaces; > uint32_t fragmentation_point; > uint16_t local_port; >- uint16_t qlen; >- uint16_t maxqlen; >+ uint32_t qlen; >+ uint32_t maxqlen; > void *socket; > #if defined(__LP64__) > uint32_t extra_padding[29]; /* future */ >Index: sys/sys/socketvar.h >=================================================================== >--- sys/sys/socketvar.h (revision 289686) >+++ sys/sys/socketvar.h (working copy) >@@ -1,6 +1,7 @@ > /*- > * Copyright (c) 1982, 1986, 1990, 1993 > * The Regents of the University of California. All rights reserved. >+ * Copyright (c) 2015, by 2ch.net. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -95,10 +96,10 @@ > TAILQ_HEAD(, socket) so_incomp; /* (e) queue of partial unaccepted connections */ > TAILQ_HEAD(, socket) so_comp; /* (e) queue of complete unaccepted connections */ > TAILQ_ENTRY(socket) so_list; /* (e) list of unaccepted connections */ >- u_short so_qlen; /* (e) number of unaccepted connections */ >- u_short so_incqlen; /* (e) number of unaccepted incomplete >+ u_int so_qlen; /* (e) number of unaccepted connections */ >+ u_int so_incqlen; /* (e) number of unaccepted incomplete > connections */ >- u_short so_qlimit; /* (e) max number queued connections */ >+ u_int so_qlimit; /* (e) max number queued connections */ > short so_timeo; /* (g) connection timeout */ > u_short so_error; /* (f) error affecting connection */ > struct sigio *so_sigio; /* [sg] information for async I/O or >@@ -172,9 +173,9 @@ > caddr_t so_pcb; /* another convenient handle */ > int xso_protocol; > int xso_family; >- u_short so_qlen; >- u_short so_incqlen; >- u_short so_qlimit; >+ u_int so_qlen; >+ u_int so_incqlen; >+ u_int so_qlimit; > short so_timeo; > u_short so_error; > pid_t so_pgid; >Index: usr.bin/netstat/inet.c >=================================================================== >--- usr.bin/netstat/inet.c (revision 289686) >+++ usr.bin/netstat/inet.c (working copy) >@@ -1,6 +1,7 @@ > /*- > * Copyright (c) 1983, 1988, 1993, 1995 > * The Regents of the University of California. All rights reserved. >+ * Copyright (c) 2015 2ch.net. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -479,11 +480,11 @@ > else > xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar); > if (Lflag) { >- char buf1[15]; >+ char buf1[33]; > >- snprintf(buf1, 15, "%d/%d/%d", so->so_qlen, >+ snprintf(buf1, sizeof buf1, "%u/%u/%u", so->so_qlen, > so->so_incqlen, so->so_qlimit); >- xo_emit("{:listen-queue-sizes/%-14.14s} ", buf1); >+ xo_emit("{:listen-queue-sizes/%-32.32s} ", buf1); > } else if (Tflag) { > if (istcp) > xo_emit("{:sent-retransmit-packets/%6u} " >Index: usr.bin/netstat/sctp.c >=================================================================== >--- usr.bin/netstat/sctp.c (revision 289686) >+++ usr.bin/netstat/sctp.c (working copy) >@@ -1,6 +1,7 @@ > /*- > * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved. > * Copyright (c) 2011, by Michael Tuexen. All rights reserved. >+ * Copyright (c) 2015, by 2ch.net. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are met: >@@ -467,9 +468,10 @@ > tname = "????"; > > if (Lflag) { >- char buf1[9]; >+ char buf1[22]; > >- snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen); >+ snprintf(buf1, sizeof buf1, "%u/%u", >+ xinpcb->qlen, xinpcb->maxqlen); > xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ", > pname, tname); > xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}" >Index: usr.bin/netstat/unix.c >=================================================================== >--- usr.bin/netstat/unix.c (revision 289686) >+++ usr.bin/netstat/unix.c (working copy) >@@ -1,6 +1,7 @@ > /*- > * Copyright (c) 1983, 1988, 1993 > * The Regents of the University of California. All rights reserved. >+ * Copyright (c) 2015 2ch.net. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -271,7 +272,7 @@ > struct unpcb *unp; > struct sockaddr_un *sa; > static int first = 1; >- char buf1[15]; >+ char buf1[33]; > static const char *titles[2] = { > "{T:/%-8.8s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%8.8s} " > "{T:/%8.8s} {T:/%8.8s} {T:/%8.8s} {T:Addr}\n", >@@ -310,10 +311,10 @@ > return; > > if (Lflag) { >- snprintf(buf1, 15, "%d/%d/%d", so->so_qlen, >+ snprintf(buf1, sizeof buf1, "%u/%u/%u", so->so_qlen, > so->so_incqlen, so->so_qlimit); >- xo_emit("unix {d:socket/%-14.14s}{e:queue-length/%d}" >- "{e:incomplete-queue-length/%d}{e:queue-limit/%d}", >+ xo_emit("unix {d:socket/%-32.32s}{e:queue-length/%u}" >+ "{e:incomplete-queue-length/%u}{e:queue-limit/%u}", > buf1, so->so_qlen, so->so_incqlen, so->so_qlimit); > } else { > xo_emit(format[fmt],
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203922
:
162281
|
166184
|
166298