Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-17 17:01:28 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-17 17:01:30 +0200
commitb63afbee424f9d63fc3a086cf577c0a05377a1fd (patch)
tree19f3a988b2fcce9477b789617b6655f990123241
parentf7c1154a6e0953603fba6ee3b42a5ec38700cb87 (diff)
team: set slave to promisc if team is already in promisc mode
(bsc#1051510).
-rw-r--r--patches.fixes/team-set-slave-to-promisc-if-team-is-already-in-prom.patch78
-rw-r--r--series.conf1
2 files changed, 79 insertions, 0 deletions
diff --git a/patches.fixes/team-set-slave-to-promisc-if-team-is-already-in-prom.patch b/patches.fixes/team-set-slave-to-promisc-if-team-is-already-in-prom.patch
new file mode 100644
index 0000000000..78382650bd
--- /dev/null
+++ b/patches.fixes/team-set-slave-to-promisc-if-team-is-already-in-prom.patch
@@ -0,0 +1,78 @@
+From 43c2adb9df7ddd6560fd3546d925b42cef92daa0 Mon Sep 17 00:00:00 2001
+From: Hangbin Liu <liuhangbin@gmail.com>
+Date: Mon, 8 Apr 2019 16:45:17 +0800
+Subject: [PATCH] team: set slave to promisc if team is already in promisc mode
+Git-commit: 43c2adb9df7ddd6560fd3546d925b42cef92daa0
+Patch-mainline: v5.1-rc6
+References: bsc#1051510
+
+After adding a team interface to bridge, the team interface will enter
+promisc mode. Then if we add a new slave to team0, the slave will keep
+promisc off. Fix it by setting slave to promisc on if team master is
+already in promisc mode, also do the same for allmulti.
+
+V2: add promisc and allmulti checking when delete ports
+
+Fixes: 3d249d4ca7d0 ("net: introduce ethernet teaming device")
+Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/net/team/team.c | 26 ++++++++++++++++++++++++++
+ 1 file changed, 26 insertions(+)
+
+diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
+index 6ed96fdfd96d..9ce61b019aad 100644
+--- a/drivers/net/team/team.c
++++ b/drivers/net/team/team.c
+@@ -1246,6 +1246,23 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
+ goto err_option_port_add;
+ }
+
++ /* set promiscuity level to new slave */
++ if (dev->flags & IFF_PROMISC) {
++ err = dev_set_promiscuity(port_dev, 1);
++ if (err)
++ goto err_set_slave_promisc;
++ }
++
++ /* set allmulti level to new slave */
++ if (dev->flags & IFF_ALLMULTI) {
++ err = dev_set_allmulti(port_dev, 1);
++ if (err) {
++ if (dev->flags & IFF_PROMISC)
++ dev_set_promiscuity(port_dev, -1);
++ goto err_set_slave_promisc;
++ }
++ }
++
+ netif_addr_lock_bh(dev);
+ dev_uc_sync_multiple(port_dev, dev);
+ dev_mc_sync_multiple(port_dev, dev);
+@@ -1262,6 +1279,9 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
+
+ return 0;
+
++err_set_slave_promisc:
++ __team_option_inst_del_port(team, port);
++
+ err_option_port_add:
+ team_upper_dev_unlink(team, port);
+
+@@ -1307,6 +1327,12 @@ static int team_port_del(struct team *team, struct net_device *port_dev)
+
+ team_port_disable(team, port);
+ list_del_rcu(&port->list);
++
++ if (dev->flags & IFF_PROMISC)
++ dev_set_promiscuity(port_dev, -1);
++ if (dev->flags & IFF_ALLMULTI)
++ dev_set_allmulti(port_dev, -1);
++
+ team_upper_dev_unlink(team, port);
+ netdev_rx_handler_unregister(port_dev);
+ team_port_disable_netpoll(port);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index e55fa6b14d..fc92c2f3b1 100644
--- a/series.conf
+++ b/series.conf
@@ -21777,6 +21777,7 @@
patches.fixes/nl80211-Add-NL80211_FLAG_CLEAR_SKB-flag-for-other-NL.patch
patches.drivers/ibmvnic-Enable-GRO.patch
patches.drivers/ibmvnic-Fix-netdev-feature-clobbering-during-a-reset.patch
+ patches.fixes/team-set-slave-to-promisc-if-team-is-already-in-prom.patch
patches.fixes/0001-net-bridge-multicast-use-rcu-to-access-port-list-fro.patch
patches.fixes/mISDN-Check-address-length-before-reading-address-fa.patch
patches.drivers/rt2x00-do-not-increment-sequence-number-while-re-tra.patch