diff options
author | bz <bz@FreeBSD.org> | 2005-08-01 08:14:21 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2005-08-01 08:14:21 +0000 |
commit | 6860ef65ebb48cad51b7d4caa34fb4f0e4ebbcbc (patch) | |
tree | f826c58d5d4c69db91f04f86b72fd6b772937391 /sys/netinet/ip_gre.c | |
parent | e47bf14064592ba2cfd5f5fed30cac0dfab72293 (diff) | |
download | FreeBSD-src-6860ef65ebb48cad51b7d4caa34fb4f0e4ebbcbc.zip FreeBSD-src-6860ef65ebb48cad51b7d4caa34fb4f0e4ebbcbc.tar.gz |
Add support for IPv6 over GRE [1]. PR kern/80340 includes the
FreeBSD specific ip_newid() changes NetBSD does not have.
Correct handling of non AF_INET packets passed to bpf [2].
PR: kern/80340[1], NetBSD PRs 29150[1], 30844[2]
Obtained from: NetBSD ip_gre.c rev. 1.34,1.35, if_gre.c rev. 1.56
Submitted by: Gert Doering <gert at greenie.muc.de>[2]
MFC after: 4 days
Diffstat (limited to 'sys/netinet/ip_gre.c')
-rw-r--r-- | sys/netinet/ip_gre.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c index 2304722..04dc3d9 100644 --- a/sys/netinet/ip_gre.c +++ b/sys/netinet/ip_gre.c @@ -8,6 +8,8 @@ * This code is derived from software contributed to The NetBSD Foundation * by Heiko W.Rupp <hwr@pilhuhn.de> * + * IPv6-over-GRE contributed by Gert Doering <gert@greenie.muc.de> + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -45,6 +47,7 @@ #include "opt_inet.h" #include "opt_atalk.h" +#include "opt_inet6.h" #include <sys/param.h> #include <sys/systm.h> @@ -142,6 +145,7 @@ gre_input2(struct mbuf *m ,int hlen, u_char proto) int isr; struct gre_softc *sc; u_int16_t flags; + u_int32_t af; if ((sc = gre_lookup(m, proto)) == NULL) { /* No matching tunnel or tunnel is down. */ @@ -183,14 +187,20 @@ gre_input2(struct mbuf *m ,int hlen, u_char proto) /* FALLTHROUGH */ case ETHERTYPE_IP: /* shouldn't need a schednetisr(), */ isr = NETISR_IP;/* as we are in ip_input */ + af = AF_INET; + break; +#ifdef INET6 + case ETHERTYPE_IPV6: + isr = NETISR_IPV6; + af = AF_INET6; break; +#endif #ifdef NETATALK case ETHERTYPE_ATALK: isr = NETISR_ATALK1; + af = AF_APPLETALK; break; #endif - case ETHERTYPE_IPV6: - /* FALLTHROUGH */ default: /* others not yet supported */ return (0); } @@ -208,7 +218,6 @@ gre_input2(struct mbuf *m ,int hlen, u_char proto) m_adj(m, hlen); if (GRE2IFP(sc)->if_bpf) { - u_int32_t af = AF_INET; bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m); } |