Module Name:    src
Committed By:   jdolecek
Date:           Thu Apr 30 10:04:54 UTC 2020

Modified Files:
        src/sys/net: if_bridge.c

Log Message:
for bridge(4), report the common enabled capabilities of the members
via SIOCGIFCAP for visibility


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 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.171 src/sys/net/if_bridge.c:1.172
--- src/sys/net/if_bridge.c:1.171	Mon Apr 27 20:46:01 2020
+++ src/sys/net/if_bridge.c	Thu Apr 30 10:04:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.171 2020/04/27 20:46:01 jdolecek Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.172 2020/04/30 10:04:54 jdolecek Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.171 2020/04/27 20:46:01 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.172 2020/04/30 10:04:54 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -640,6 +640,14 @@ bridge_ioctl(struct ifnet *ifp, u_long c
 			error = 0;
 		break;
 
+        case SIOCGIFCAP:
+	    {
+		struct ifcapreq *ifcr = (struct ifcapreq *)data;
+                ifcr->ifcr_capabilities = sc->sc_capenable;
+                ifcr->ifcr_capenable = sc->sc_capenable;
+		break;
+	    }
+
 	default:
 		error = ifioctl_common(ifp, cmd, data);
 		break;
@@ -781,13 +789,16 @@ bridge_calc_csum_flags(struct bridge_sof
 	struct bridge_iflist *bif;
 	struct ifnet *ifs;
 	int flags = ~0;
+	int capenable = ~0;
 
 	BRIDGE_LOCK(sc);
 	BRIDGE_IFLIST_READER_FOREACH(bif, sc) {
 		ifs = bif->bif_ifp;
 		flags &= ifs->if_csum_flags_tx;
+		capenable &= ifs->if_capenable;
 	}
 	sc->sc_csum_flags_tx = flags;
+	sc->sc_capenable = capenable;
 	BRIDGE_UNLOCK(sc);
 }
 

Reply via email to