aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_tunnel_key.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2020-09-13 19:51:50 +0800
committerDavid S. Miller <davem@davemloft.net>2020-09-14 16:49:39 -0700
commit13e6ce98aa65ab5ce19351c020419360dfe8af29 (patch)
tree85f3cd4dd493f7ed32eceefe7b5c9755a81f8b70 /net/sched/act_tunnel_key.c
parenttipc: use skb_unshare() instead in tipc_buf_append() (diff)
downloadlinux-dev-13e6ce98aa65ab5ce19351c020419360dfe8af29.tar.xz
linux-dev-13e6ce98aa65ab5ce19351c020419360dfe8af29.zip
net: sched: only keep the available bits when setting vxlan md->gbp
As we can see from vxlan_build/parse_gbp_hdr(), when processing metadata on vxlan rx/tx path, only dont_learn/policy_applied/policy_id fields can be set to or parse from the packet for vxlan gbp option. So we'd better do the mask when set it in act_tunnel_key and cls_flower. Otherwise, when users don't know these bits, they may configure with a value which can never be matched. Reported-by: Shuang Li <shuali@redhat.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_tunnel_key.c')
-rw-r--r--net/sched/act_tunnel_key.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c
index 536c4bc31be6..37f1e10f35e0 100644
--- a/net/sched/act_tunnel_key.c
+++ b/net/sched/act_tunnel_key.c
@@ -156,6 +156,7 @@ tunnel_key_copy_vxlan_opt(const struct nlattr *nla, void *dst, int dst_len,
struct vxlan_metadata *md = dst;
md->gbp = nla_get_u32(tb[TCA_TUNNEL_KEY_ENC_OPT_VXLAN_GBP]);
+ md->gbp &= VXLAN_GBP_MASK;
}
return sizeof(struct vxlan_metadata);