Bug 13740

Summary: wrong IP statistics
Product: Base System Reporter: freedom <freedom>
Component: kernAssignee: jlemon
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   

Description freedom 1999-09-13 23:30:00 UTC
	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;

Fix: 

Please remove the code fragment, or add IF_DROP.
How-To-Repeat: 
	Just let some heavy UDP traffic compete for the same output queue.
Comment 1 jlemon freebsd_committer freebsd_triage 2001-10-30 15:04:15 UTC
Responsible Changed
From-To: freebsd-bugs->jlemon

Reminder to MFC fix and close PR.
Comment 2 Maxim Konovalov 2002-01-23 11:18:19 UTC
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
Comment 3 perisa 2002-05-29 00:04:57 UTC
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
Comment 4 Maxim Konovalov freebsd_committer freebsd_triage 2002-09-08 15:07:36 UTC
State Changed
From-To: open->closed

Fixed in rev. 1.40 and rev. 1.99.2.22 sys/netinet/ip_output.c in -current 
ans -stable.