From 5fea5fca6526057768b36b8712660fa8c1671946 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Wed, 2 Sep 2020 11:24:05 +0200 Subject: [PATCH] tapsetup: FreeBSD/OSX: remove member TAPs of bridge explicitly --- dist/tools/tapsetup/tapsetup | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/tools/tapsetup/tapsetup b/dist/tools/tapsetup/tapsetup index 77a7d21a6e..4e2e52e9b6 100755 --- a/dist/tools/tapsetup/tapsetup +++ b/dist/tools/tapsetup/tapsetup @@ -219,6 +219,9 @@ delete_bridge() { case "${PLATFORM}" in FreeBSD) sysctl net.link.tap.user_open=0 + for IF in $(ifconfig ${BRIDGE} | grep -oiE "member: .+ " | cut -d' ' -f2); do + ifconfig $IF destroy || exit 1 + done ifconfig ${BRNAME} destroy || exit 1 kldunload if_tap # unloading might fail due to dependencies kldunload if_bridge ;; @@ -236,6 +239,9 @@ delete_bridge() { update_uplink ${UPLINK} fi ;; OSX) + for IF in $(ifconfig ${BRIDGE} | grep -oiE "member: .+ " | cut -d' ' -f2); do + ifconfig $IF destroy || exit 1 + done ifconfig ${BRNAME} destroy || exit 1 ;; *) ;;