On 15.12.2016 20:51, hiren panchasara wrote: > On 12/15/16 at 05:23P, Eugene M. Zheganin wrote: >> Hi. >> >> Sometimes on one of my servers I got dmesg full of >> >> sonewconn: pcb 0xfffff80373aec000: Listen queue overflow: 49 already in >> queue awaiting acceptance (6 occurrences) > [skip] >> >> but at the time of investigation the socket is already closed and lsof >> cannot show me the owner. I wonder if the kernel can itself decode this >> output and write it in the human-readable form ? > > I have this not-quite-correct patch that may help you. (If you follow the > discussion there, you'd know why its not complete.) > > https://lists.freebsd.org/pipermail/freebsd-net/2014-March/038074.html
Hi Hiren, I think the check for socket's domain should be enough? -- WBR, Andrey V. Elsukov
Index: sys/kern/uipc_socket.c
===================================================================
--- sys/kern/uipc_socket.c (revision 309834)
+++ sys/kern/uipc_socket.c (working copy)
@@ -139,6 +139,7 @@ __FBSDID("$FreeBSD$");
#include <sys/jail.h>
#include <sys/syslog.h>
#include <netinet/in.h>
+#include <netinet/in_pcb.h>
#include <net/vnet.h>
@@ -577,10 +578,15 @@ sonewconn(struct socket *head, int connstatus)
overcount++;
if (ratecheck(&lastover, &overinterval)) {
- log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: "
- "%i already in queue awaiting acceptance "
- "(%d occurrences)\n",
- __func__, head->so_pcb, head->so_qlen, overcount);
+ if (INP_CHECK_SOCKAF(head, AF_INET) ||
+ INP_CHECK_SOCKAF(head, AF_INET6))
+ over = ntohs(sotoinpcb(head)->inp_lport);
+ else
+ over = 0;
+ log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow on "
+ "port %d: %i already in queue awaiting acceptance "
+ "(%d occurrences)\n", __func__, head->so_pcb,
+ over, head->so_qlen, overcount);
overcount = 0;
}
signature.asc
Description: OpenPGP digital signature
