net: bridge: avoid duplicate notification on up/down/change netdev events
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Thu, 3 May 2018 10:47:24 +0000 (13:47 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 May 2018 17:40:54 +0000 (13:40 -0400)
commitfaa1cd8298439cf56f7fd2d8647726b30c263bf0
tree651cbd227fc7cb4252c03f66a07f608a9a31378a
parent2e5185519450afe948e6418a699799c60ac8597d
net: bridge: avoid duplicate notification on up/down/change netdev events

While handling netdevice events, br_device_event() sometimes uses
br_stp_(disable|enable)_port which unconditionally send a notification,
but then a second notification for the same event is sent at the end of
the br_device_event() function. To avoid sending duplicate notifications
in such cases, check if one has already been sent (i.e.
br_stp_enable/disable_port have been called).
The patch is based on a change by Satish Ashok.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br.c
net/bridge/br_if.c
net/bridge/br_private.h