Subject: Re: altq 3.0 and pppd ?
To: None <hwidarta@yahoo.com>
From: Kenjiro Cho <kjc@csl.sony.co.jp>
List: tech-net
Date: 01/12/2002 01:50:45
----Next_Part(Sat_Jan_12_01:50:45_2002_380)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hendra Widarta wrote:
> Hi Scott and Kenjiro,
> 
> Re: altq 3.0 kernel interacts negatively with pppd? 
> (Mailing archives 10/17/2001)
> 
> Is there any solution for altq interacts with pppd?
> 
> My problem and Scott's are the same,
> under NetBSD-1.5.2, altq-3.0 and ppp-2.4.0

Could you try the attached patch for sys/net/if_ppp.c?
It's relative to altq-3.0/NetBSD-1.5.2.

-Kenjiro

----Next_Part(Sat_Jan_12_01:50:45_2002_380)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="if_ppp.c.diff"

--- if_ppp.c-	Sat Jan 12 01:21:55 2002
+++ if_ppp.c	Sat Jan 12 01:47:32 2002
@@ -148,6 +148,9 @@
 static void	ppp_ccp_closed __P((struct ppp_softc *));
 static void	ppp_inproc __P((struct ppp_softc *, struct mbuf *));
 static void	pppdumpm __P((struct mbuf *m0));
+#ifdef ALTQ
+static void	ppp_ifstart __P((struct ifnet *ifp));
+#endif
 
 /*
  * Some useful mbuf macros not in mbuf.h.
@@ -212,6 +215,9 @@
 	sc->sc_if.if_hdrlen = PPP_HDRLEN;
 	sc->sc_if.if_ioctl = pppsioctl;
 	sc->sc_if.if_output = pppoutput;
+#ifdef ALTQ
+	sc->sc_if.if_start = ppp_ifstart;
+#endif
 	IFQ_SET_MAXLEN(&sc->sc_if.if_snd, IFQ_MAXLEN);
 	sc->sc_inq.ifq_maxlen = IFQ_MAXLEN;
 	sc->sc_fastq.ifq_maxlen = IFQ_MAXLEN;
@@ -1666,5 +1672,21 @@
     *bp = 0;
     printf("%s\n", buf);
 }
+
+#ifdef ALTQ
+/*
+ * a wrapper to transmit a packet from if_start since ALTQ uses
+ * if_start to send a packet.
+ */
+static void
+ppp_ifstart(ifp)
+	struct ifnet *ifp;
+{
+	struct ppp_softc *sc;
+
+	sc = ifp->if_softc;
+	(*sc->sc_start)(sc);
+}
+#endif
 
 #endif	/* NPPP > 0 */

----Next_Part(Sat_Jan_12_01:50:45_2002_380)----