From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 11 11:50:16 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EADF116A41F for ; Thu, 11 Aug 2005 11:50:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B178543D46 for ; Thu, 11 Aug 2005 11:50:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j7BBoFlj006360 for ; Thu, 11 Aug 2005 11:50:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j7BBoFVs006359; Thu, 11 Aug 2005 11:50:15 GMT (envelope-from gnats) Date: Thu, 11 Aug 2005 11:50:15 GMT Message-Id: <200508111150.j7BBoFVs006359@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Gleb Smirnoff Cc: Subject: Re: kern/84686: kernel panic with if_ppp X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gleb Smirnoff List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2005 11:50:16 -0000 The following reply was made to PR kern/84686; it has been noted by GNATS. From: Gleb Smirnoff To: Vladimir Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/84686: kernel panic with if_ppp Date: Thu, 11 Aug 2005 15:08:20 +0400 --/e2eDi0V/xtL+Mc8 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Can you please try out this patch. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE --/e2eDi0V/xtL+Mc8 Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename="ppp.diff" Index: if_ppp.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_ppp.c,v retrieving revision 1.106 diff -u -r1.106 if_ppp.c --- if_ppp.c 9 Aug 2005 10:19:58 -0000 1.106 +++ if_ppp.c 11 Aug 2005 11:01:19 -0000 @@ -160,22 +160,6 @@ static int ppp_clone_create(struct if_clone *, int); static void ppp_clone_destroy(struct ifnet *); -struct ppp_softc * -ppp_for_tty(struct tty *tp) -{ - struct ppp_softc *sc; - - PPP_LIST_LOCK(); - LIST_FOREACH(sc, &ppp_softc_list, sc_list) { - if (sc->sc_devp == (void*)tp) { - PPP_LIST_UNLOCK(); - return (sc); - } - } - PPP_LIST_UNLOCK(); - return (NULL); -} - IFC_SIMPLE_DECLARE(ppp, 0); /* Index: if_pppvar.h =================================================================== RCS file: /home/ncvs/src/sys/net/if_pppvar.h,v retrieving revision 1.23 diff -u -r1.23 if_pppvar.h --- if_pppvar.h 10 Jun 2005 16:49:18 -0000 1.23 +++ if_pppvar.h 11 Aug 2005 11:01:37 -0000 @@ -110,4 +110,3 @@ void ppp_restart(struct ppp_softc *sc); void ppppktin(struct ppp_softc *sc, struct mbuf *m, int lost); struct mbuf *ppp_dequeue(struct ppp_softc *sc); -struct ppp_softc *ppp_for_tty(struct tty *); Index: ppp_tty.c =================================================================== RCS file: /home/ncvs/src/sys/net/ppp_tty.c,v retrieving revision 1.67 diff -u -r1.67 ppp_tty.c --- ppp_tty.c 9 Aug 2005 10:19:58 -0000 1.67 +++ ppp_tty.c 11 Aug 2005 11:03:33 -0000 @@ -212,6 +212,7 @@ PPP2IFP(sc)->if_baudrate = tp->t_ospeed; tp->t_hotchar = PPP_FLAG; + tp->t_lsc = sc; ttyflush(tp, FREAD | FWRITE); /* @@ -240,14 +241,13 @@ struct tty *tp; int flag; { - register struct ppp_softc *sc; + register struct ppp_softc *sc = (struct ppp_softc *)tp->t_lsc; int s; s = spltty(); ttyflush(tp, FREAD | FWRITE); clist_free_cblocks(&tp->t_canq); clist_free_cblocks(&tp->t_outq); - sc = ppp_for_tty(tp); if (sc != NULL) { pppasyncrelinq(sc); pppdealloc(sc); @@ -309,7 +309,7 @@ struct uio *uio; int flag; { - register struct ppp_softc *sc = ppp_for_tty(tp); + register struct ppp_softc *sc = (struct ppp_softc *)tp->t_lsc; struct mbuf *m, *m0; register int s; int error = 0; @@ -368,7 +368,7 @@ struct uio *uio; int flag; { - register struct ppp_softc *sc = ppp_for_tty(tp); + register struct ppp_softc *sc = (struct ppp_softc *)tp->t_lsc; struct mbuf *m; struct sockaddr dst; int error, s; @@ -414,7 +414,7 @@ int flag; struct thread *td; { - struct ppp_softc *sc = ppp_for_tty(tp); + struct ppp_softc *sc = (struct ppp_softc *)tp->t_lsc; int error, s; if (sc == NULL || tp != (struct tty *) sc->sc_devp) @@ -729,7 +729,7 @@ pppstart(tp) register struct tty *tp; { - register struct ppp_softc *sc = ppp_for_tty(tp); + register struct ppp_softc *sc = (struct ppp_softc *)tp->t_lsc; /* * Call output process whether or not there is any output. @@ -815,7 +815,7 @@ struct mbuf *m; int ilen, s; - sc = ppp_for_tty(tp); + sc = (struct ppp_softc *)tp->t_lsc; if (sc == NULL) return 0; --/e2eDi0V/xtL+Mc8--