summaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2016-02-16 21:59:03 +0100
committerDavid S. Miller <davem@davemloft.net>2016-02-17 23:52:12 -0500
commitb9167b2e775999d267874b5a1a3a79020f54753a (patch)
tree7208c2dd2669bfe11a132652c27ac8406293cbdf /drivers/net/vxlan.c
parent288b01c8c46eda01cd3921c6e3aca6293e57cee8 (diff)
downloadop-kernel-dev-b9167b2e775999d267874b5a1a3a79020f54753a.zip
op-kernel-dev-b9167b2e775999d267874b5a1a3a79020f54753a.tar.gz
vxlan: treat vni in metadata based tunnels consistently
For metadata based tunnels, VNI is ignored when doing vxlan device lookups (because such tunnel receives all VNIs). However, this was not honored by vxlan_xmit_one when doing encapsulation bypass. Move the check for metadata based tunnel to the common place where it belongs. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index dfbb3cb..3a84680 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -246,6 +246,10 @@ static struct vxlan_dev *vxlan_vs_find_vni(struct vxlan_sock *vs, __be32 vni)
{
struct vxlan_dev *vxlan;
+ /* For flow based devices, map all packets to VNI 0 */
+ if (vs->flags & VXLAN_F_COLLECT_METADATA)
+ vni = 0;
+
hlist_for_each_entry_rcu(vxlan, vni_head(vs, vni), hlist) {
if (vxlan->default_dst.remote_vni == vni)
return vxlan;
@@ -1194,10 +1198,6 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb,
union vxlan_addr saddr;
int err = 0;
- /* For flow based devices, map all packets to VNI 0 */
- if (vs->flags & VXLAN_F_COLLECT_METADATA)
- vni = 0;
-
/* Is this VNI defined? */
vxlan = vxlan_vs_find_vni(vs, vni);
if (!vxlan)
OpenPOWER on IntegriCloud