aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2014-11-07 12:05:20 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2014-11-07 12:05:20 +0000
commitb6e1ad3a3a2f414cc4a67ffcdb92c47e444cdc9f (patch)
treed726c1a7a11df6619dc345ea419d02bb7e96f1d3 /sys
parent20dc9e174049c755584e964d88a81b97694b26fb (diff)
downloadsrc-b6e1ad3a3a2f414cc4a67ffcdb92c47e444cdc9f.tar.gz
src-b6e1ad3a3a2f414cc4a67ffcdb92c47e444cdc9f.zip
Pass mbuf to pfil processing before stripping outer IP header as it
is described in if_enc(4). MFC after: 2 week Sponsored by: Yandex LLC
Notes
Notes: svn path=/head/; revision=274230
Diffstat (limited to 'sys')
-rw-r--r--sys/netipsec/ipsec_input.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c
index e9fe6e362f2c..b0fa0f29aac5 100644
--- a/sys/netipsec/ipsec_input.c
+++ b/sys/netipsec/ipsec_input.c
@@ -379,15 +379,10 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav,
if_inc_counter(encif, IFCOUNTER_IPACKETS, 1);
if_inc_counter(encif, IFCOUNTER_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 */
@@ -683,16 +678,10 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int proto
if_inc_counter(encif, IFCOUNTER_IPACKETS, 1);
if_inc_counter(encif, IFCOUNTER_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 */
#ifdef INET