]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: slave: Don't propagate flag changes on down slave interfaces
authorRundong Ge <rdong.ge@gmail.com>
Sat, 2 Feb 2019 14:29:35 +0000 (14:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Feb 2019 02:29:35 +0000 (18:29 -0800)
commit9f7bf5af8efd472d9f9f580acd23f7aa024fcfea
tree51e18b3664c3fc3768425fe9a79fe6164f4459ed
parentf52660d1576d2b89c9ab1251fc266a01ceae837b
net: dsa: slave: Don't propagate flag changes on down slave interfaces

The unbalance of master's promiscuity or allmulti will happen after ifdown
and ifup a slave interface which is in a bridge.

When we ifdown a slave interface , both the 'dsa_slave_close' and
'dsa_slave_change_rx_flags' will clear the master's flags. The flags
of master will be decrease twice.
In the other hand, if we ifup the slave interface again, since the
slave's flags were cleared the 'dsa_slave_open' won't set the master's
flag, only 'dsa_slave_change_rx_flags' that triggered by 'br_add_if'
will set the master's flags. The flags of master is increase once.

Only propagating flag changes when a slave interface is up makes
sure this does not happen. The 'vlan_dev_change_rx_flags' had the
same problem and was fixed, and changes here follows that fix.

Fixes: 676811fd1972 ("net: Distributed Switch Architecture protocol support")
Signed-off-by: Rundong Ge <rdong.ge@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c