diff options
author | Jiri Benc <jbenc@redhat.com> | 2016-02-18 21:19:29 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-18 21:55:24 +0300 |
commit | 07dabf20d9867710b90b91108b2adcd448773e25 (patch) | |
tree | 5fba2742a7df7451a1127c38b475f347623b6104 /drivers/net/vxlan.c | |
parent | f169af2cdc069f5c7a6bce8e565728b841ae56e0 (diff) | |
download | linux-07dabf20d9867710b90b91108b2adcd448773e25.tar.xz |
vxlan: tun_id is 64bit, not 32bit
The tun_id field in struct ip_tunnel_key is __be64, not __be32. We need to
convert the vni to tun_id correctly.
Fixes: 54bfd872bf16 ("vxlan: keep flags and vni in network byte order")
Reported-by: Paolo Abeni <pabeni@redhat.com>
Tested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r-- | drivers/net/vxlan.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 3a84680b5117..75bccb360599 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1310,9 +1310,10 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) goto drop; if (vxlan_collect_metadata(vs)) { + __be32 vni = vxlan_vni(vxlan_hdr(skb)->vx_vni); + tun_dst = udp_tun_rx_dst(skb, vxlan_get_sk_family(vs), TUNNEL_KEY, - vxlan_vni(vxlan_hdr(skb)->vx_vni), - sizeof(*md)); + vxlan_vni_to_tun_id(vni), sizeof(*md)); if (!tun_dst) goto drop; |