summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2005-06-20 08:39:30 +0000
committerbz <bz@FreeBSD.org>2005-06-20 08:39:30 +0000
commite8078a9f9351362b113e5efb80a3de1f99fe8dce (patch)
tree40e253015ad00e30036aaa68048b0ba384770208
parente7465f07053f082d8b228a709803eea9897d7a29 (diff)
downloadFreeBSD-src-e8078a9f9351362b113e5efb80a3de1f99fe8dce.zip
FreeBSD-src-e8078a9f9351362b113e5efb80a3de1f99fe8dce.tar.gz
Fix IP(v6) over IP tunneling most likely broken with ifnet changes.
Reviewed by: gnn Approved by: re (dwhite), rwatson (mentor)
-rw-r--r--sys/netinet/in_gif.c9
1 files changed, 8 insertions, 1 deletions
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++;
OpenPOWER on IntegriCloud