From e8078a9f9351362b113e5efb80a3de1f99fe8dce Mon Sep 17 00:00:00 2001 From: bz Date: Mon, 20 Jun 2005 08:39:30 +0000 Subject: Fix IP(v6) over IP tunneling most likely broken with ifnet changes. Reviewed by: gnn Approved by: re (dwhite), rwatson (mentor) --- sys/netinet/in_gif.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index aeed444..8b43f73 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -225,6 +225,7 @@ in_gif_input(m, off) int off; { struct ifnet *gifp = NULL; + struct gif_softc *sc; struct ip *ip; int af; u_int8_t otos; @@ -233,8 +234,14 @@ in_gif_input(m, off) ip = mtod(m, struct ip *); proto = ip->ip_p; - gifp = (struct ifnet *)encap_getarg(m); + sc = (struct gif_softc *)encap_getarg(m); + if (sc == NULL) { + m_freem(m); + ipstat.ips_nogif++; + return; + } + gifp = GIF2IFP(sc); if (gifp == NULL || (gifp->if_flags & IFF_UP) == 0) { m_freem(m); ipstat.ips_nogif++; -- cgit v1.1