summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2018-11-14 03:20:04 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2018-11-14 03:20:04 +0000
commit86110ab3e03be9c4a2e45a940eab9265c57d614d (patch)
tree857bce2bf9dafffc78e7e070c5e8902db59782e1
parent16892d0a22f5b21f9fece49e618a3c0134fd5a08 (diff)
remove the encapsulation headers before looking at the inner headers
it works less well when you look before the adj
-rw-r--r--sys/net/if_gif.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 141cac7199c..093c4a95153 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gif.c,v 1.122 2018/11/14 02:49:15 dlg Exp $ */
+/* $OpenBSD: if_gif.c,v 1.123 2018/11/14 03:20:03 dlg Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
@@ -791,6 +791,10 @@ gif_input(struct gif_tunnel *key, struct mbuf **mp, int *offp, int proto,
return (-1);
}
+ m_adj(m, *offp); /* this is ours now */
+
+ ifp = &sc->sc_if;
+
switch (proto) {
case IPPROTO_IPV4: {
struct ip *ip;
@@ -843,10 +847,6 @@ gif_input(struct gif_tunnel *key, struct mbuf **mp, int *offp, int proto,
return (-1);
}
- m_adj(m, *offp);
-
- ifp = &sc->sc_if;
-
m->m_flags &= ~(M_MCAST|M_BCAST);
m->m_pkthdr.ph_ifidx = ifp->if_index;
m->m_pkthdr.ph_rtableid = ifp->if_rdomain;