From owner-freebsd-net@FreeBSD.ORG Thu May 8 22:30:52 2008 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EC42106567F for ; Thu, 8 May 2008 22:30:52 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 0FA998FC29 for ; Thu, 8 May 2008 22:30:51 +0000 (UTC) (envelope-from andre@freebsd.org) Received: (qmail 80991 invoked from network); 8 May 2008 21:32:26 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 8 May 2008 21:32:26 -0000 Message-ID: <48237F1A.6020601@freebsd.org> Date: Fri, 09 May 2008 00:30:50 +0200 From: Andre Oppermann User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: John Baldwin References: <200805081625.33093.jhb@FreeBSD.org> In-Reply-To: <200805081625.33093.jhb@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@FreeBSD.org Subject: Re: Small patch.. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2008 22:30:52 -0000 John Baldwin wrote: > At work all the log(LOG_DEBUG, ...) statements in the TCP code in 7.x are > spamming the heck out of our dmesg so I am #if 0'ing all of them out and > while doing so ran into this case. Specifically, it doesn't actually bump sysctl net.inet.tcp.log_debug=0 is simpler than #if 0 and has the same effect. In RELENG_7 it was disabled by default. > the stat counter unless it succeeds in allocating memory to log the debug > message. All the other places in the syncache and tcp input code always bump > the stats, so this patch fixes it to do that. Your fix is correct. -- Andre > Index: tcp_syncache.c > =================================================================== > RCS file: /usr/cvs/src/sys/netinet/tcp_syncache.c,v > retrieving revision 1.143 > diff -u -r1.143 tcp_syncache.c > --- tcp_syncache.c 19 Apr 2008 03:39:17 -0000 1.143 > +++ tcp_syncache.c 8 May 2008 20:22:21 -0000 > @@ -567,10 +567,11 @@ > "connection attempt aborted by remote endpoint\n", > s, __func__); > tcpstat.tcps_sc_reset++; > - } else if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { > - log(LOG_DEBUG, "%s; %s: RST with invalid SEQ %u != IRS %u " > - "(+WND %u), segment ignored\n", > - s, __func__, th->th_seq, sc->sc_irs, sc->sc_wnd); > + } else { > + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) > + log(LOG_DEBUG, "%s; %s: RST with invalid SEQ %u != " > + "IRS %u (+WND %u), segment ignored\n", > + s, __func__, th->th_seq, sc->sc_irs, sc->sc_wnd); > tcpstat.tcps_badrst++; > } > >