diff options
author | cognet <cognet@FreeBSD.org> | 2004-11-07 14:35:53 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-11-07 14:35:53 +0000 |
commit | 13ca89b942fcb65daa1bc4e4ba32af7369d910d9 (patch) | |
tree | d3509db0fc9945e4ae502dfdf00476fb0049b487 /sys/net/if_ppp.c | |
parent | 4bdb4a9e2f9859da7c62b0bed5ae9739c282bc8c (diff) | |
download | FreeBSD-src-13ca89b942fcb65daa1bc4e4ba32af7369d910d9.zip FreeBSD-src-13ca89b942fcb65daa1bc4e4ba32af7369d910d9.tar.gz |
Don't abuse tp->t_sc, as it is now used by tty drivers.
This fixes the panic that occurs when using ppp(4)
Reported and tested by: Yann Berthier (yb at sainte-barbe dot org)
Diffstat (limited to 'sys/net/if_ppp.c')
-rw-r--r-- | sys/net/if_ppp.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index eaab431..53b0b42 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -158,6 +158,22 @@ static void pppdumpm(struct mbuf *m0); 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); /* |