summaryrefslogtreecommitdiff
path: root/net/sched/cls_flower.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-09-15 02:49:39 +0300
committerDavid S. Miller <davem@davemloft.net>2020-09-15 02:49:39 +0300
commitad7b27c9e64afce4ad69020329a3e89f6df4f382 (patch)
tree4eb7a4a9a92ba5e9dbcf96ce35b879738bcf6e7c /net/sched/cls_flower.c
parentff48b6222e65ebdba5a403ef1deba6214e749193 (diff)
parent681d2cfb790339a3e95b98bc140baf1f816a896a (diff)
downloadlinux-ad7b27c9e64afce4ad69020329a3e89f6df4f382.tar.xz
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/cls_flower.c')
-rw-r--r--net/sched/cls_flower.c4
1 files changed, 3 insertions, 1 deletions
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);
}