diff options
author | David S. Miller <davem@davemloft.net> | 2016-03-08 13:58:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-08 13:58:52 -0500 |
commit | d24ad3fc0e454b4354acc10149ecceda445d6a75 (patch) | |
tree | 5ae7116e18f4bd6646ba8f5809a1d1eb6efbda33 /net/ipv4 | |
parent | 810813c47a564416f6306ae214e2661366c987a7 (diff) | |
parent | 1400615d64cf5afee533aff8234c837da465841b (diff) | |
download | blackbird-op-linux-d24ad3fc0e454b4354acc10149ecceda445d6a75.tar.gz blackbird-op-linux-d24ad3fc0e454b4354acc10149ecceda445d6a75.zip |
Merge branch 'bpf-next'
Daniel Borkmann says:
====================
BPF updates
Couple of misc updates to BPF, besides others this series adds
bpf_csum_diff() to be used with L3 csums, allows for managing
tunnel options for collect meta data mode, and enabling ipv6
traffic class for collect meta data in vxlan specifically (geneve
already supports it). For more details, please see individual
patches.
The series requires net to be merged into net-next first to
avoid any further pending merge conflicts.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_gre.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 202437d6087b..31936d387cfd 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -527,11 +527,12 @@ static void gre_fb_xmit(struct sk_buff *skb, struct net_device *dev) { struct ip_tunnel_info *tun_info; const struct ip_tunnel_key *key; + struct rtable *rt = NULL; struct flowi4 fl; - struct rtable *rt; int min_headroom; int tunnel_hlen; __be16 df, flags; + bool use_cache; int err; tun_info = skb_tunnel_info(skb); @@ -540,13 +541,14 @@ static void gre_fb_xmit(struct sk_buff *skb, struct net_device *dev) goto err_free_skb; key = &tun_info->key; - rt = !skb->mark ? dst_cache_get_ip4(&tun_info->dst_cache, &fl.saddr) : - NULL; + use_cache = ip_tunnel_dst_cache_usable(skb, tun_info); + if (use_cache) + rt = dst_cache_get_ip4(&tun_info->dst_cache, &fl.saddr); if (!rt) { rt = gre_get_rt(skb, dev, &fl, key); if (IS_ERR(rt)) goto err_free_skb; - if (!skb->mark) + if (use_cache) dst_cache_set_ip4(&tun_info->dst_cache, &rt->dst, fl.saddr); } |