tapsetup: FreeBSD/OSX: remove member TAPs of bridge explicitly

This commit is contained in:
Martine S. Lenders 2020-09-02 11:24:05 +02:00
parent 29684af116
commit 5fea5fca65
No known key found for this signature in database
GPG Key ID: CCD317364F63286F

View File

@ -219,6 +219,9 @@ delete_bridge() {
case "${PLATFORM}" in case "${PLATFORM}" in
FreeBSD) FreeBSD)
sysctl net.link.tap.user_open=0 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 ifconfig ${BRNAME} destroy || exit 1
kldunload if_tap # unloading might fail due to dependencies kldunload if_tap # unloading might fail due to dependencies
kldunload if_bridge ;; kldunload if_bridge ;;
@ -236,6 +239,9 @@ delete_bridge() {
update_uplink ${UPLINK} update_uplink ${UPLINK}
fi ;; fi ;;
OSX) OSX)
for IF in $(ifconfig ${BRIDGE} | grep -oiE "member: .+ " | cut -d' ' -f2); do
ifconfig $IF destroy || exit 1
done
ifconfig ${BRNAME} destroy || exit 1 ;; ifconfig ${BRNAME} destroy || exit 1 ;;
*) *)
;; ;;