Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:08:48 +0100
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:09:52 +0100
commitc6b03f38c3e81428b24a51b9d2fd8278c7c5b182 (patch)
treeb6c518dc2a7e0ac1ab92f0fef323ce107e3d9524
parent47083065c43c8ca2608a6714c0265a4daf438e30 (diff)
vxlan: fix unexpected failure of vxlan_changelink()
(bsc#1154353).
-rw-r--r--patches.suse/vxlan-fix-unexpected-failure-of-vxlan_changelink.patch56
-rw-r--r--series.conf1
2 files changed, 57 insertions, 0 deletions
diff --git a/patches.suse/vxlan-fix-unexpected-failure-of-vxlan_changelink.patch b/patches.suse/vxlan-fix-unexpected-failure-of-vxlan_changelink.patch
new file mode 100644
index 0000000000..5a0998acf3
--- /dev/null
+++ b/patches.suse/vxlan-fix-unexpected-failure-of-vxlan_changelink.patch
@@ -0,0 +1,56 @@
+From: Taehee Yoo <ap420073@gmail.com>
+Date: Wed, 30 Oct 2019 08:15:12 +0000
+Subject: vxlan: fix unexpected failure of vxlan_changelink()
+Patch-mainline: v5.4-rc6
+Git-commit: c6761cf521f9bffbdcbb619dba665ebf3bcefb1e
+References: bsc#1154353
+
+After commit 0ce1822c2a08 ("vxlan: add adjacent link to limit depth
+level"), vxlan_changelink() could fail because of
+netdev_adjacent_change_prepare().
+netdev_adjacent_change_prepare() returns -EEXIST when old lower device
+and new lower device are same.
+(old lower device is "dst->remote_dev" and new lower device is "lowerdev")
+So, before calling it, lowerdev should be NULL if these devices are same.
+
+Test command1:
+ ip link add dummy0 type dummy
+ ip link add vxlan0 type vxlan dev dummy0 dstport 4789 vni 1
+ ip link set vxlan0 type vxlan ttl 5
+ RTNETLINK answers: File exists
+
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Fixes: 0ce1822c2a08 ("vxlan: add adjacent link to limit depth level")
+Signed-off-by: Taehee Yoo <ap420073@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+---
+ drivers/net/vxlan.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/vxlan.c
++++ b/drivers/net/vxlan.c
+@@ -3967,6 +3967,9 @@ static int vxlan_changelink(struct net_d
+ if (err)
+ return err;
+
++ if (dst->remote_dev == lowerdev)
++ lowerdev = NULL;
++
+ err = netdev_adjacent_change_prepare(dst->remote_dev, lowerdev, dev,
+ extack);
+ if (err)
+@@ -4008,10 +4011,10 @@ static int vxlan_changelink(struct net_d
+ mod_timer(&vxlan->age_timer, jiffies);
+
+ netdev_adjacent_change_commit(dst->remote_dev, lowerdev, dev);
+- if (lowerdev && lowerdev != dst->remote_dev)
++ if (lowerdev && lowerdev != dst->remote_dev) {
+ dst->remote_dev = lowerdev;
+-
+- netdev_update_lockdep_key(lowerdev);
++ netdev_update_lockdep_key(lowerdev);
++ }
+ vxlan_config_apply(dev, &conf, lowerdev, vxlan->net, true);
+ return 0;
+ }
diff --git a/series.conf b/series.conf
index b336563dd0..cc42eadba8 100644
--- a/series.conf
+++ b/series.conf
@@ -2882,6 +2882,7 @@
patches.suse/net-mlx5e-Fix-ethtool-self-test-link-speed.patch
patches.suse/net-mlx5e-Initialize-on-stack-link-modes-bitmap.patch
patches.suse/qed-fix-spelling-mistake-queuess-queues.patch
+ patches.suse/vxlan-fix-unexpected-failure-of-vxlan_changelink.patch
patches.suse/powerpc-powernv-Fix-CPU-idle-to-be-called-with-IRQs-.patch
patches.suse/scsi-qla2xxx-fixup-incorrect-usage-of-host_byte.patch
patches.suse/scsi-lpfc-Check-queue-pointer-before-use.patch