Module Name: src Committed By: rin Date: Sat Dec 22 04:28:30 UTC 2018
Modified Files: src/sys/net: if_bridge.c Log Message: Take the interface out of promiscuous mode in bridge_delete_member() instead of bridge_ioctl_del(). Otherwise, the member interfaces are left in promiscuous mode when the bridge is destroyed. To generate a diff of this commit: cvs rdiff -u -r1.163 -r1.164 src/sys/net/if_bridge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_bridge.c diff -u src/sys/net/if_bridge.c:1.163 src/sys/net/if_bridge.c:1.164 --- src/sys/net/if_bridge.c:1.163 Sat Dec 15 07:38:58 2018 +++ src/sys/net/if_bridge.c Sat Dec 22 04:28:30 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bridge.c,v 1.163 2018/12/15 07:38:58 rin Exp $ */ +/* $NetBSD: if_bridge.c,v 1.164 2018/12/22 04:28:30 rin Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -80,7 +80,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.163 2018/12/15 07:38:58 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.164 2018/12/22 04:28:30 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_bridge_ipf.h" @@ -743,6 +743,25 @@ bridge_delete_member(struct bridge_softc BRIDGE_PSZ_PERFORM(sc); BRIDGE_UNLOCK(sc); + switch (ifs->if_type) { + case IFT_ETHER: + case IFT_L2TP: + /* + * Take the interface out of promiscuous mode. + * Don't call it with holding a spin lock. + */ + (void) ifpromisc(ifs, 0); + IFNET_LOCK(ifs); + (void) ether_disable_vlan_mtu(ifs); + IFNET_UNLOCK(ifs); + break; + default: +#ifdef DIAGNOSTIC + panic("%s: impossible", __func__); +#endif + break; + } + psref_target_destroy(&bif->bif_psref, bridge_psref_class); PSLIST_ENTRY_DESTROY(bif, bif_next); @@ -897,25 +916,6 @@ bridge_ioctl_del(struct bridge_softc *sc BRIDGE_UNLOCK(sc); - switch (ifs->if_type) { - case IFT_ETHER: - case IFT_L2TP: - /* - * Take the interface out of promiscuous mode. - * Don't call it with holding a spin lock. - */ - (void) ifpromisc(ifs, 0); - IFNET_LOCK(ifs); - (void) ether_disable_vlan_mtu(ifs); - IFNET_UNLOCK(ifs); - break; - default: -#ifdef DIAGNOSTIC - panic("bridge_delete_member: impossible"); -#endif - break; - } - bridge_rtdelete(sc, ifs); bridge_calc_csum_flags(sc);