Source-Changes-HG archive

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

[src/trunk]: src/sys/net report no enabled capabilities when no interface is ...



details:   https://anonhg.NetBSD.org/src/rev/cac3fe14fcda
branches:  trunk
changeset: 1009745:cac3fe14fcda
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri May 01 22:27:42 2020 +0000

description:
report no enabled capabilities when no interface is part of bridge

diffstat:

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

diffs (36 lines):

diff -r 6a8ae8d1576b -r cac3fe14fcda sys/net/if_bridge.c
--- a/sys/net/if_bridge.c       Fri May 01 22:26:11 2020 +0000
+++ b/sys/net/if_bridge.c       Fri May 01 22:27:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bridge.c,v 1.172 2020/04/30 10:04:54 jdolecek Exp $ */
+/*     $NetBSD: if_bridge.c,v 1.173 2020/05/01 22:27:42 jdolecek Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.172 2020/04/30 10:04:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.173 2020/05/01 22:27:42 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -787,7 +787,7 @@
 bridge_calc_csum_flags(struct bridge_softc *sc)
 {
        struct bridge_iflist *bif;
-       struct ifnet *ifs;
+       struct ifnet *ifs = NULL;
        int flags = ~0;
        int capenable = ~0;
 
@@ -798,7 +798,7 @@
                capenable &= ifs->if_capenable;
        }
        sc->sc_csum_flags_tx = flags;
-       sc->sc_capenable = capenable;
+       sc->sc_capenable = (ifs != NULL) ? capenable : 0;
        BRIDGE_UNLOCK(sc);
 }
 



Home | Main Index | Thread Index | Old Index