aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2020-09-13 19:51:51 +0800
committerDavid S. Miller <davem@davemloft.net>2020-09-14 16:49:39 -0700
commit681d2cfb790339a3e95b98bc140baf1f816a896a (patch)
tree4eb7a4a9a92ba5e9dbcf96ce35b879738bcf6e7c /net/ipv4
parentnet: sched: only keep the available bits when setting vxlan md->gbp (diff)
downloadwireguard-linux-681d2cfb790339a3e95b98bc140baf1f816a896a.tar.xz
wireguard-linux-681d2cfb790339a3e95b98bc140baf1f816a896a.zip
lwtunnel: 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 do the mask when set it in lwtunnel, as it does in act_tunnel_key and cls_flower. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ip_tunnel_core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 75c6013ff9a4..b2ea1a8c5fd6 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -554,6 +554,7 @@ static int ip_tun_parse_opts_vxlan(struct nlattr *attr,
attr = tb[LWTUNNEL_IP_OPT_VXLAN_GBP];
md->gbp = nla_get_u32(attr);
+ md->gbp &= VXLAN_GBP_MASK;
info->key.tun_flags |= TUNNEL_VXLAN_OPT;
}