summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_gif.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-06-20 20:17:00 +0000
committerume <ume@FreeBSD.org>2005-06-20 20:17:00 +0000
commit38dbaac82ee687da9cfa55687d4f83e540718269 (patch)
tree79ef9c063508115edeebacad6078529d44f9f6ae /sys/netinet6/in6_gif.c
parent2ca7877009986198e0b32487e3222c876e4ce25a (diff)
downloadFreeBSD-src-38dbaac82ee687da9cfa55687d4f83e540718269.zip
FreeBSD-src-38dbaac82ee687da9cfa55687d4f83e540718269.tar.gz
fix IP(v4) over IPv6 tunneling most likely broken with ifnet changes.
Submitted by: bz Approved by: re (dwhite)
Diffstat (limited to 'sys/netinet6/in6_gif.c')
-rw-r--r--sys/netinet6/in6_gif.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c
index c9123d7..632ff8f 100644
--- a/sys/netinet6/in6_gif.c
+++ b/sys/netinet6/in6_gif.c
@@ -234,14 +234,21 @@ in6_gif_input(mp, offp, proto)
{
struct mbuf *m = *mp;
struct ifnet *gifp = NULL;
+ struct gif_softc *sc;
struct ip6_hdr *ip6;
int af = 0;
u_int32_t otos;
ip6 = mtod(m, struct ip6_hdr *);
- gifp = (struct ifnet *)encap_getarg(m);
+ sc = (struct gif_softc *)encap_getarg(m);
+ if (sc == NULL) {
+ m_freem(m);
+ ip6stat.ip6s_nogif++;
+ return IPPROTO_DONE;
+ }
+ gifp = GIF2IFP(sc);
if (gifp == NULL || (gifp->if_flags & IFF_UP) == 0) {
m_freem(m);
ip6stat.ip6s_nogif++;
OpenPOWER on IntegriCloud