Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Take the interface out of promiscuous mode in bridge...



details:   https://anonhg.NetBSD.org/src/rev/5b46f8f4d92a
branches:  trunk
changeset: 995419:5b46f8f4d92a
user:      rin <rin%NetBSD.org@localhost>
date:      Sat Dec 22 04:28:30 2018 +0000

description:
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.

diffstat:

 sys/net/if_bridge.c |  42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diffs (70 lines):

diff -r 20c26310a911 -r 5b46f8f4d92a sys/net/if_bridge.c
--- a/sys/net/if_bridge.c       Sat Dec 22 03:22:19 2018 +0000
+++ b/sys/net/if_bridge.c       Sat Dec 22 04:28:30 2018 +0000
@@ -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_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_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);
 



Home | Main Index | Thread Index | Old Index