From owner-freebsd-net@FreeBSD.ORG Thu May 8 20:45:55 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 99011106566B; Thu, 8 May 2008 20:45:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7FD8F8FC18; Thu, 8 May 2008 20:45:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from server.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id B7E791A4D82; Thu, 8 May 2008 13:25:57 -0700 (PDT) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m48KPjtx006478; Thu, 8 May 2008 16:25:45 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: andre@FreeBSD.org Date: Thu, 8 May 2008 16:25:32 -0400 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805081625.33093.jhb@FreeBSD.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 08 May 2008 16:25:46 -0400 (EDT) X-Virus-Scanned: ClamAV 0.91.2/7064/Thu May 8 08:36:43 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-net@FreeBSD.org Subject: 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 20:45:55 -0000 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 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. 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++; } -- John Baldwin