Source-Changes-HG archive

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

[src/trunk]: src/sys/net If the bridge is not running, don't call bridge_stop...



details:   https://anonhg.NetBSD.org/src/rev/437684e26304
branches:  trunk
changeset: 829038:437684e26304
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Jan 15 09:49:16 2018 +0000

description:
If the bridge is not running, don't call bridge_stop. Otherwise the
following commands will crash the kernel:

        ifconfig bridge0 create
        ifconfig bridge0 destroy

diffstat:

 sys/net/if_bridge.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 56ac1c33098b -r 437684e26304 sys/net/if_bridge.c
--- a/sys/net/if_bridge.c       Mon Jan 15 09:48:28 2018 +0000
+++ b/sys/net/if_bridge.c       Mon Jan 15 09:49:16 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bridge.c,v 1.147 2017/12/28 07:06:36 ozaki-r Exp $  */
+/*     $NetBSD: if_bridge.c,v 1.148 2018/01/15 09:49:16 maxv Exp $     */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.147 2017/12/28 07:06:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.148 2018/01/15 09:49:16 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -469,7 +469,8 @@
        struct bridge_softc *sc = ifp->if_softc;
        struct bridge_iflist *bif;
 
-       bridge_stop(ifp, 1);
+       if ((ifp->if_flags & IFF_RUNNING) != 0)
+               bridge_stop(ifp, 1);
 
        BRIDGE_LOCK(sc);
        for (;;) {



Home | Main Index | Thread Index | Old Index