Module Name: src Committed By: ozaki-r Date: Mon Dec 16 05:20:31 UTC 2024
Modified Files: src/sys/net: if_bridge.c Log Message: bridge: remove redundant IFF_RUNNING check It has been done in bridge_input, so doing in bridge_forward is redundant and yet racy. Also it fixes a possible mbuf leak. To generate a diff of this commit: cvs rdiff -u -r1.194 -r1.195 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.194 src/sys/net/if_bridge.c:1.195 --- src/sys/net/if_bridge.c:1.194 Tue Sep 3 07:59:48 2024 +++ src/sys/net/if_bridge.c Mon Dec 16 05:20:31 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bridge.c,v 1.194 2024/09/03 07:59:48 ozaki-r Exp $ */ +/* $NetBSD: if_bridge.c,v 1.195 2024/12/16 05:20:31 ozaki-r Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -80,7 +80,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.194 2024/09/03 07:59:48 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.195 2024/12/16 05:20:31 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1813,9 +1813,6 @@ bridge_forward(struct bridge_softc *sc, DECLARE_LOCK_VARIABLE; bool src_if_protected; - if ((sc->sc_if.if_flags & IFF_RUNNING) == 0) - return; - src_if = m_get_rcvif_psref(m, &psref_src); if (src_if == NULL) { /* Interface is being destroyed? */