diff options
author | Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> | 2014-06-05 20:53:32 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-05 15:20:31 -0700 |
commit | e0a47d1f781665d2aa126b804572314d128a0070 (patch) | |
tree | 33e5c9567445408009567209adcd7abec9f20aed | |
parent | 5fb22ee5a2cc2b32f2b64015cc679e24ed6f50d4 (diff) | |
download | lwn-e0a47d1f781665d2aa126b804572314d128a0070.tar.gz lwn-e0a47d1f781665d2aa126b804572314d128a0070.zip |
bridge: Fix incorrect judgment of promisc
br_manage_promisc() incorrectly expects br_auto_port() to return only 0
or 1, while it actually returns flags, i.e., a subset of BR_AUTO_MASK.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/bridge/br_if.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index a08d2b8ebba6..3eca3fdf8fe1 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -153,7 +153,8 @@ void br_manage_promisc(struct net_bridge *br) * This lets us disable promiscuous mode and write * this config to hw. */ - if (br->auto_cnt <= br_auto_port(p)) + if (br->auto_cnt == 0 || + (br->auto_cnt == 1 && br_auto_port(p))) br_port_clear_promisc(p); else br_port_set_promisc(p); |