Subject: Re: ALTQ and pppoe
To: None <aszeszo@o2.pl>
From: Kenjiro Cho <kjc@csl.sony.co.jp>
List: tech-net
Date: 07/07/2003 13:40:40
Andrzej Szeszo wrote:
> Is it normal behaviour that ALTQ doesn't work with pppoe interface on
> 1.6.1_STABLE/i386. When I start altqd with simple rule in config file on
> pppoe0 interface it stops working. Same rule works ok on ethernet
> interface (ep) in the same machine.
> 
> I have found in archives that some people have similar problems with
> ppp interface but I haven't found any solution :(

Could you try the following patch?
(the diff is for kame/netbsd-1.6.1 but should apply to stock 1.6
and -current.)
The problem was found and fixed by OpenBSD sometime ago.

-Kenjiro

Index: netbsd/sys/net/if_tun.c
===================================================================
RCS file: /cvsroot/kame/kame/netbsd/sys/net/if_tun.c,v
retrieving revision 1.7
diff -u -r1.7 if_tun.c
--- netbsd/sys/net/if_tun.c	25 Sep 2002 11:45:05 -0000	1.7
+++ netbsd/sys/net/if_tun.c	7 Jul 2003 04:31:29 -0000
@@ -524,6 +524,7 @@
 {
 	int		s;
 	struct tun_softc *tp;
+	struct mbuf *m;
 
 	tp = tun_find_unit(dev);
 
@@ -585,8 +586,9 @@
 
 	case FIONREAD:
 		s = splnet();
-		if (tp->tun_if.if_snd.ifq_head)
-			*(int *)data = tp->tun_if.if_snd.ifq_head->m_pkthdr.len;
+		IFQ_POLL(&tp->tun_if.if_snd, m);
+		if (m != NULL)
+			*(int *)data = m->m_pkthdr.len;
 		else	
 			*(int *)data = 0;
 		splx(s);