diff options
Diffstat (limited to 'net/ipv6/xfrm6_input.c')
-rw-r--r-- | net/ipv6/xfrm6_input.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c index 28c29d78338e..1ca2da68ef69 100644 --- a/net/ipv6/xfrm6_input.c +++ b/net/ipv6/xfrm6_input.c | |||
@@ -11,6 +11,8 @@ | |||
11 | 11 | ||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/string.h> | 13 | #include <linux/string.h> |
14 | #include <linux/netfilter.h> | ||
15 | #include <linux/netfilter_ipv6.h> | ||
14 | #include <net/dsfield.h> | 16 | #include <net/dsfield.h> |
15 | #include <net/inet_ecn.h> | 17 | #include <net/inet_ecn.h> |
16 | #include <net/ip.h> | 18 | #include <net/ip.h> |
@@ -26,7 +28,7 @@ static inline void ipip6_ecn_decapsulate(struct sk_buff *skb) | |||
26 | IP6_ECN_set_ce(inner_iph); | 28 | IP6_ECN_set_ce(inner_iph); |
27 | } | 29 | } |
28 | 30 | ||
29 | int xfrm6_rcv_spi(struct sk_buff **pskb, unsigned int *nhoffp, u32 spi) | 31 | int xfrm6_rcv_spi(struct sk_buff **pskb, u32 spi) |
30 | { | 32 | { |
31 | struct sk_buff *skb = *pskb; | 33 | struct sk_buff *skb = *pskb; |
32 | int err; | 34 | int err; |
@@ -38,7 +40,7 @@ int xfrm6_rcv_spi(struct sk_buff **pskb, unsigned int *nhoffp, u32 spi) | |||
38 | int nexthdr; | 40 | int nexthdr; |
39 | unsigned int nhoff; | 41 | unsigned int nhoff; |
40 | 42 | ||
41 | nhoff = *nhoffp; | 43 | nhoff = IP6CB(skb)->nhoff; |
42 | nexthdr = skb->nh.raw[nhoff]; | 44 | nexthdr = skb->nh.raw[nhoff]; |
43 | 45 | ||
44 | seq = 0; | 46 | seq = 0; |
@@ -121,6 +123,8 @@ int xfrm6_rcv_spi(struct sk_buff **pskb, unsigned int *nhoffp, u32 spi) | |||
121 | skb->sp->len += xfrm_nr; | 123 | skb->sp->len += xfrm_nr; |
122 | skb->ip_summed = CHECKSUM_NONE; | 124 | skb->ip_summed = CHECKSUM_NONE; |
123 | 125 | ||
126 | nf_reset(skb); | ||
127 | |||
124 | if (decaps) { | 128 | if (decaps) { |
125 | if (!(skb->dev->flags&IFF_LOOPBACK)) { | 129 | if (!(skb->dev->flags&IFF_LOOPBACK)) { |
126 | dst_release(skb->dst); | 130 | dst_release(skb->dst); |
@@ -129,7 +133,16 @@ int xfrm6_rcv_spi(struct sk_buff **pskb, unsigned int *nhoffp, u32 spi) | |||
129 | netif_rx(skb); | 133 | netif_rx(skb); |
130 | return -1; | 134 | return -1; |
131 | } else { | 135 | } else { |
136 | #ifdef CONFIG_NETFILTER | ||
137 | skb->nh.ipv6h->payload_len = htons(skb->len); | ||
138 | __skb_push(skb, skb->data - skb->nh.raw); | ||
139 | |||
140 | NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL, | ||
141 | ip6_rcv_finish); | ||
142 | return -1; | ||
143 | #else | ||
132 | return 1; | 144 | return 1; |
145 | #endif | ||
133 | } | 146 | } |
134 | 147 | ||
135 | drop_unlock: | 148 | drop_unlock: |
@@ -144,7 +157,7 @@ drop: | |||
144 | 157 | ||
145 | EXPORT_SYMBOL(xfrm6_rcv_spi); | 158 | EXPORT_SYMBOL(xfrm6_rcv_spi); |
146 | 159 | ||
147 | int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) | 160 | int xfrm6_rcv(struct sk_buff **pskb) |
148 | { | 161 | { |
149 | return xfrm6_rcv_spi(pskb, nhoffp, 0); | 162 | return xfrm6_rcv_spi(pskb, 0); |
150 | } | 163 | } |