|
@@ -65,7 +65,6 @@ static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
|
|
goto drop;
|
|
goto drop;
|
|
|
|
|
|
XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
|
|
XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
|
|
- skb->mark = be32_to_cpu(tunnel->parms.i_key);
|
|
|
|
|
|
|
|
return xfrm_input(skb, nexthdr, spi, encap_type);
|
|
return xfrm_input(skb, nexthdr, spi, encap_type);
|
|
}
|
|
}
|
|
@@ -91,6 +90,8 @@ static int vti_rcv_cb(struct sk_buff *skb, int err)
|
|
struct pcpu_sw_netstats *tstats;
|
|
struct pcpu_sw_netstats *tstats;
|
|
struct xfrm_state *x;
|
|
struct xfrm_state *x;
|
|
struct ip_tunnel *tunnel = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4;
|
|
struct ip_tunnel *tunnel = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4;
|
|
|
|
+ u32 orig_mark = skb->mark;
|
|
|
|
+ int ret;
|
|
|
|
|
|
if (!tunnel)
|
|
if (!tunnel)
|
|
return 1;
|
|
return 1;
|
|
@@ -107,7 +108,11 @@ static int vti_rcv_cb(struct sk_buff *skb, int err)
|
|
x = xfrm_input_state(skb);
|
|
x = xfrm_input_state(skb);
|
|
family = x->inner_mode->afinfo->family;
|
|
family = x->inner_mode->afinfo->family;
|
|
|
|
|
|
- if (!xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family))
|
|
|
|
|
|
+ skb->mark = be32_to_cpu(tunnel->parms.i_key);
|
|
|
|
+ ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family);
|
|
|
|
+ skb->mark = orig_mark;
|
|
|
|
+
|
|
|
|
+ if (!ret)
|
|
return -EPERM;
|
|
return -EPERM;
|
|
|
|
|
|
skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(skb->dev)));
|
|
skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(skb->dev)));
|