summaryrefslogtreecommitdiffstats
path: root/sys/net/if_bridgevar.h
diff options
context:
space:
mode:
authorkp <kp@FreeBSD.org>2017-02-01 20:27:38 +0000
committerkp <kp@FreeBSD.org>2017-02-01 20:27:38 +0000
commit6fb6e78d7db7ea7b185cfb56f02ccc51ed1a1ec8 (patch)
tree6ac176997368f4945ff9c38e4bdf9ff1d902063b /sys/net/if_bridgevar.h
parente9830aac197cdde03c3703c63d689793051e9773 (diff)
downloadFreeBSD-src-6fb6e78d7db7ea7b185cfb56f02ccc51ed1a1ec8.zip
FreeBSD-src-6fb6e78d7db7ea7b185cfb56f02ccc51ed1a1ec8.tar.gz
MFC 312782
bridge: Release the bridge lock when calling bridge_set_ifcap() This calls ioctl() handlers for the different interfaces in the bridge. These handlers expect to get called in an ioctl context where it's safe for them to sleep. We may not sleep with the bridge lock held. However, we still need to protect the interface list, to ensure it doesn't get changed while we iterate over it. Use BRIDGE_XLOCK(), which prevents bridge members from being removed. Adding bridge members is safe, because it uses LIST_INSERT_HEAD(). This caused panics when adding xen interfaces to a bridge. PR: 216304 Reviewed by: ae Sponsored by: RootBSD Differential Revision: https://reviews.freebsd.org/D9290
Diffstat (limited to 'sys/net/if_bridgevar.h')
-rw-r--r--sys/net/if_bridgevar.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h
index 3210c03..480c90a 100644
--- a/sys/net/if_bridgevar.h
+++ b/sys/net/if_bridgevar.h
@@ -280,6 +280,7 @@ struct ifbpstpconf {
#define BRIDGE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
#define BRIDGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
#define BRIDGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED)
+#define BRIDGE_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED)
#define BRIDGE_LOCK2REF(_sc, _err) do { \
mtx_assert(&(_sc)->sc_mtx, MA_OWNED); \
if ((_sc)->sc_iflist_xcnt > 0) \
OpenPOWER on IntegriCloud