Source-Changes-HG archive

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

[src/trunk]: src/sys/net PR/46587: Roger Pau Monne: Prevent panic on shutdown...



details:   https://anonhg.NetBSD.org/src/rev/63abce30bab1
branches:  trunk
changeset: 780242:63abce30bab1
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jul 17 18:08:20 2012 +0000

description:
PR/46587: Roger Pau Monne: Prevent panic on shutdown on bridge teardown ->
ifpromisc-> if_ioctl -> if_init. Idea from dyoung.
XXX: Pullup to 6.

diffstat:

 sys/net/if_ethersubr.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r dc36944ea400 -r 63abce30bab1 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c    Tue Jul 17 14:39:08 2012 +0000
+++ b/sys/net/if_ethersubr.c    Tue Jul 17 18:08:20 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ethersubr.c,v 1.189 2012/05/11 04:05:54 chs Exp $   */
+/*     $NetBSD: if_ethersubr.c,v 1.190 2012/07/17 18:08:20 christos Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.189 2012/05/11 04:05:54 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.190 2012/07/17 18:08:20 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_atalk.h"
@@ -1144,6 +1144,15 @@
        struct ether_multi *enm;
        int s;
 
+       /*
+        * Prevent further calls to ioctl (for example turning off
+        * promiscuous mode from the bridge code), which eventually can
+        * call if_init() which can cause panics because the interface
+        * is in the process of being detached. Return device not configured
+        * instead.
+        */
+       ifp->if_ioctl = (int (*)(struct ifnet *, u_long, void *))enxio;
+
 #if NBRIDGE > 0
        if (ifp->if_bridge)
                bridge_ifdetach(ifp);



Home | Main Index | Thread Index | Old Index