diff options
author | ae <ae@FreeBSD.org> | 2014-11-21 15:21:39 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2014-11-21 15:21:39 +0000 |
commit | 8273e80777c3a4960018df0b3bb35ce43281fca2 (patch) | |
tree | 69b50b0f2293f87602b96456ce00fd0b02fe1109 /sys/netipsec | |
parent | 76e2f9a8d7bda9826faa9d78d98ddd4d2248e5c1 (diff) | |
download | FreeBSD-src-8273e80777c3a4960018df0b3bb35ce43281fca2.zip FreeBSD-src-8273e80777c3a4960018df0b3bb35ce43281fca2.tar.gz |
MFC r274230:
Pass mbuf to pfil processing before stripping outer IP header as it
is described in if_enc(4).
Diffstat (limited to 'sys/netipsec')
-rw-r--r-- | sys/netipsec/ipsec_input.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c index 199a3bf..677ef00 100644 --- a/sys/netipsec/ipsec_input.c +++ b/sys/netipsec/ipsec_input.c @@ -353,15 +353,10 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, encif->if_ipackets++; encif->if_ibytes += m->m_pkthdr.len; - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. - */ + /* Pass the mbuf to enc0 for bpf and pfil. */ ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE); - - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); #endif /* DEV_ENC */ /* IP-in-IP encapsulation */ @@ -657,16 +652,10 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int proto encif->if_ipackets++; encif->if_ibytes += m->m_pkthdr.len; - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. - */ + /* Pass the mbuf to enc0 for bpf and pfil. */ ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE); - - /* XXX-BZ does not make sense. */ - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); #endif /* DEV_ENC */ /* IPv6-in-IP encapsulation */ |