From owner-freebsd-net@FreeBSD.ORG Wed Mar 19 03:33:25 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 990B0192 for ; Wed, 19 Mar 2014 03:33:25 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69C8C7F8 for ; Wed, 19 Mar 2014 03:33:25 +0000 (UTC) Received: from pool-96-250-5-187.nycmny.fios.verizon.net ([96.250.5.187]:64451 helo=minion.home) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1WQ7Fs-0004Rj-1p; Tue, 18 Mar 2014 23:33:24 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Include port number in "Listen queue overflow" messages From: George Neville-Neil In-Reply-To: Date: Tue, 18 Mar 2014 23:33:23 -0400 X-Mao-Original-Outgoing-Id: 416892803.279549-30537c8e51b987b5d4f253032f0e1ff0 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: hiren panchasara X-Mailer: Apple Mail (2.1874) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 03:33:25 -0000 On Mar 7, 2014, at 1:23 , hiren panchasara = wrote: > I am thinking of committing following change that includes port number > in "Listen queue overflow" messages. >=20 I like it. Best, George > New message would look something like: > sonewconn: pcb 0xfffff8001b155760: Listen queue overflow on port > 13120: 1 already in queue awaiting acceptance (454 occurrences) >=20 > I've recently ran into a situation at $work where I could not catch > the culprit application via "netstat -A" and had to dive into kgdb to > find the port from pcb where this application was listening to. >=20 > IMO, this change will make debugging easier. >=20 > cheers, > Hiren >=20 > Index: sys/kern/uipc_socket.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/kern/uipc_socket.c (revision 262861) > +++ sys/kern/uipc_socket.c (working copy) > @@ -136,6 +136,7 @@ > #include > #include > #include > +#include >=20 > #include >=20 > @@ -491,8 +492,11 @@ > static int overcount; >=20 > struct socket *so; > + struct inpcb *inp; > int over; >=20 > + inp =3D sotoinpcb(head); > + > ACCEPT_LOCK(); > over =3D (head->so_qlen > 3 * head->so_qlimit / 2); > ACCEPT_UNLOCK(); > @@ -504,10 +508,12 @@ > overcount++; >=20 > if (ratecheck(&lastover, &overinterval)) { > - log(LOG_DEBUG, "%s: pcb %p: Listen queue = overflow: " > - "%i already in queue awaiting acceptance " > + 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, head->so_qlen, = overcount); > + __func__, head->so_pcb, > + ntohs(inp->inp_inc.inc_lport), = head->so_qlen, > + overcount); >=20 > overcount =3D 0; > } > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"