Module Name: src Committed By: maxv Date: Mon Jan 15 09:49:16 UTC 2018
Modified Files: src/sys/net: if_bridge.c Log Message: 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 To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 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.147 src/sys/net/if_bridge.c:1.148 --- src/sys/net/if_bridge.c:1.147 Thu Dec 28 07:06:36 2017 +++ src/sys/net/if_bridge.c Mon Jan 15 09:49:16 2018 @@ -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 @@ bridge_clone_destroy(struct ifnet *ifp) 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 (;;) {