kernel: add missing check for skb->dev on netfilter xfrm optimization patch
authorFelix Fietkau <nbd@openwrt.org>
Mon, 8 Dec 2014 12:21:17 +0000 (12:21 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 8 Dec 2014 12:21:17 +0000 (12:21 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 43567

target/linux/generic/patches-3.10/616-net_optimize_xfrm_calls.patch
target/linux/generic/patches-3.14/616-net_optimize_xfrm_calls.patch
target/linux/generic/patches-3.18/616-net_optimize_xfrm_calls.patch

index 5724367c1f1f177716f74fd09385220f1b231892..1caf1ef59c9c39edaa4e1bee805c0a1674ace3a6 100644 (file)
@@ -4,7 +4,7 @@
        struct dst_entry *dst;
        int err;
  
-+      if (!dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
++      if (skb->dev && !dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
 +              return 0;
 +
        err = xfrm_decode_session(skb, &fl, family);
index a4e41573001671f0c640d1dc17761c2c4a395398..2a64d5420a4c7f17b674eca6d1b6671d265e4a0c 100644 (file)
@@ -4,7 +4,7 @@
        struct dst_entry *dst;
        int err;
  
-+      if (!dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
++      if (skb->dev && !dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
 +              return 0;
 +
        err = xfrm_decode_session(skb, &fl, family);
index a4e41573001671f0c640d1dc17761c2c4a395398..2a64d5420a4c7f17b674eca6d1b6671d265e4a0c 100644 (file)
@@ -4,7 +4,7 @@
        struct dst_entry *dst;
        int err;
  
-+      if (!dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
++      if (skb->dev && !dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
 +              return 0;
 +
        err = xfrm_decode_session(skb, &fl, family);