kernel: add a small xfrm related performance optimization
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.14 / 616-net_optimize_xfrm_calls.patch
1 --- a/net/netfilter/nf_nat_core.c
2 +++ b/net/netfilter/nf_nat_core.c
3 @@ -90,6 +90,9 @@ int nf_xfrm_me_harder(struct sk_buff *sk
4 struct dst_entry *dst;
5 int err;
6
7 + if (!dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
8 + return 0;
9 +
10 err = xfrm_decode_session(skb, &fl, family);
11 if (err < 0)
12 return err;
13