diff options
author | David S. Miller <davem@davemloft.net> | 2020-09-15 01:49:39 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-15 01:49:39 +0200 |
commit | ad7b27c9e64afce4ad69020329a3e89f6df4f382 (patch) | |
tree | 4eb7a4a9a92ba5e9dbcf96ce35b879738bcf6e7c /net/sched | |
parent | tipc: use skb_unshare() instead in tipc_buf_append() (diff) | |
parent | lwtunnel: only keep the available bits when setting vxlan md->gbp (diff) | |
download | linux-ad7b27c9e64afce4ad69020329a3e89f6df4f382.tar.xz linux-ad7b27c9e64afce4ad69020329a3e89f6df4f382.zip |
Merge branch 'net-improve-vxlan-option-process-in-net_sched-and-lwtunnel'
Xin Long says:
====================
net: improve vxlan option process in net_sched and lwtunnel
This patch is to do some mask when setting vxlan option in net_sched
and lwtunnel, so that only available bits can be set on vxlan md gbp.
This would help when users don't know exactly vxlan's gbp bits, and
avoid some mismatch because of some unavailable bits set by users.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/act_tunnel_key.c | 1 | ||||
-rw-r--r-- | net/sched/cls_flower.c | 4 |
2 files changed, 4 insertions, 1 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); diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index a4f7ef1de7e7..e8fda1bd4d9d 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -1175,8 +1175,10 @@ static int fl_set_vxlan_opt(const struct nlattr *nla, struct fl_flow_key *key, return -EINVAL; } - if (tb[TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP]) + if (tb[TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP]) { md->gbp = nla_get_u32(tb[TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP]); + md->gbp &= VXLAN_GBP_MASK; + } return sizeof(*md); } |