Subject: kern/16559: ALTQ and IPNAT do not mix well.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <svs@ropnet.ru>
List: netbsd-bugs
Date: 04/29/2002 13:18:07
>Number:         16559
>Category:       kern
>Synopsis:       ALTQ and IPNAT do not mix well.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 29 13:19:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Svishchev
>Release:        1.5-current (1.5Y)
>Organization:
>Environment:
>Description:
Most, if not all, traffic that passes IPNAT on ALTQ-enabled kernel with ALTQ active, is not classified by ALTQ (and thus is not subjected to any limits set in altq.conf).
>How-To-Repeat:

>Fix:
Index: if_ethersubr.c
===================================================================
RCS file: /cvsroot/syssrc/sys/net/if_ethersubr.c,v
retrieving revision 1.89
diff -u -r1.89 if_ethersubr.c
--- if_ethersubr.c	2001/10/17 08:23:05	1.89
+++ if_ethersubr.c	2002/02/20 16:39:27
@@ -542,6 +542,7 @@
     struct altq_pktattr *pktattr)
 {
 	struct ether_header *eh;
+	struct mbuf *n;
 	u_int16_t ether_type;
 	int hlen, af, hdrsize;
 	caddr_t hdr;
@@ -589,11 +590,15 @@
 		 * Ethernet and protocol header not in a single
 		 * mbuf.  We can't cope with this situation right
 		 * now (but it shouldn't ever happen, really, anyhow).
-		 * XXX Should use m_pulldown().
+		 * XXX Should use m_pulldown(). -- Now what?
 		 */
-		printf("altq_etherclassify: headers span multiple mbufs: "
-		    "%d < %d\n", m->m_len, (hlen + hdrsize));
-		goto bad;
+		n = m_pulldown(m, 0, hlen + hdrsize, NULL);
+		if (n == NULL) {
+			printf("altq_etherclassify: headers span multiple mbufs: "
+				"%d < %d\n", m->m_len, (hlen + hdrsize));
+			goto bad;
+		} else
+			m = n;
 	}
 
 	m->m_data += hlen;




>Release-Note:
>Audit-Trail:
>Unformatted: