From freedom@liberty.dorm11.nctu.edu.tw Mon Sep 13 15:22:46 1999
Return-Path: <freedom@liberty.dorm11.nctu.edu.tw>
Received: from liberty.dorm11.nctu.edu.tw (liberty.Dorm11.NCTU.edu.tw [140.113.191.85])
	by hub.freebsd.org (Postfix) with ESMTP id 899C0155E4
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Sep 1999 15:22:40 -0700 (PDT)
	(envelope-from freedom@liberty.dorm11.nctu.edu.tw)
Received: (from freedom@localhost)
	by liberty.dorm11.nctu.edu.tw (8.9.3/8.8.8) id GAA12704;
	Tue, 14 Sep 1999 06:21:58 +0800 (CST)
	(envelope-from freedom)
Message-Id: <199909132221.GAA12704@liberty.dorm11.nctu.edu.tw>
Date: Tue, 14 Sep 1999 06:21:58 +0800 (CST)
From: freedom@csie.nctu.edu.tw
Sender: freedom@liberty.dorm11.nctu.edu.tw
Reply-To: freedom@csie.nctu.edu.tw
To: FreeBSD-gnats-submit@freebsd.org
Subject: wrong IP statistics
X-Send-Pr-Version: 3.2

>Number:         13740
>Category:       kern
>Synopsis:       wrong IP statistics
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    jlemon
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 13 15:30:00 PDT 1999
>Closed-Date:    Sun Sep 08 07:10:02 PDT 2002
>Last-Modified:  Sun Sep 08 07:10:02 PDT 2002
>Originator:     Tan Koan-Sin
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
NCTU, Taiwan
>Environment:
	
	While doing some network experiment, we found that we 
	always see
		0 output packets dropped due to no bufs, etc.
	from the output of "netstat -s". It's unbelievable, because
   	we generated heavy traffic.

>Description:

	The following code fragment is buggy.
	(line 362-370 of $Id: ip_output.c,v 1.90 1999/05/04 16:20:33 luigi Exp$)

	/*
         * Verify that we have any chance at all of being able to queue
         *      the packet or packet fragments
         */
        if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
                ifp->if_snd.ifq_maxlen) {
                        error = ENOBUFS;
                        goto bad;
        } 

	1. I don't think we should check queue length here. Because even 
	   the condition is true. The output queue could have enough space 
	   when the packet is in if_output().
	2. Even 1. is wrong, there should be 
		IF_DROP(&ifp->if_snd);
	   before 
		error = ENOBUFS;

>How-To-Repeat:

	Just let some heavy UDP traffic compete for the same output queue.
	
>Fix:
 	Please remove the code fragment, or add IF_DROP.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jlemon 
Responsible-Changed-By: jlemon 
Responsible-Changed-When: Tue Oct 30 07:04:15 PST 2001 
Responsible-Changed-Why:  
Reminder to MFC fix and close PR. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=13740 

From: Maxim Konovalov <maxim@macomnet.ru>
To: freebsd-gnats-submit@FreeBSD.org, <freedom@csie.nctu.edu.tw>
Cc:  
Subject: Re: kern/13740: wrong IP statistics
Date: Wed, 23 Jan 2002 14:18:19 +0300 (MSK)

 Fixed in -current and -stable:
 
 http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/ip_output.c?rev=1.99.2.22&content-type=text/x-cvsweb-markup
 
 -- 
 Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer
 phone: +7 (095) 796-9079, mailto: maxim@macomnet.ru
 

From: Marc Perisa <perisa@porsche.de>
To: freebsd-gnats-submit@FreeBSD.org, jlemon@FreeBSD.org
Cc: freedom@csie.nctu.edu.tw
Subject: Re: kern/13740: wrong IP statistics
Date: Wed, 29 May 2002 01:04:57 +0200

 Hi,
 
 the problem was fixed as described. Please close the PR.
 
 Confirmed to work on:
 
 FreeBSD latte.spaetfruehstuecken.org 4.3-STABLE FreeBSD 4.3-STABLE #0: 
 Tue Mar 26 16:22:49 CET 2002   
 
 Thanks
 
 Marc
 
 
 
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Sun Sep 8 07:07:36 PDT 2002 
State-Changed-Why:  
Fixed in rev. 1.40 and rev. 1.99.2.22 sys/netinet/ip_output.c in -current 
ans -stable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13740 
>Unformatted:
