Module Name: src
Committed By: msaitoh
Date: Fri Sep 14 11:05:09 UTC 2018
Modified Files:
src/sys/net: if_bridge.c
Log Message:
Fix a bug that bridge_enqueue() incorrectly cleared outgoing packet's offload
flags. bridge_enqueue() is called from bridge_output() when a packet is
spontaneous. Clear csum_flags before calling brige_enqueue() in
bridge_forward() or bridge_broadcast() instead of in the beginning of
bridge_enqueue().
Note that this change doesn't fix a problem on the following configuration:
A bridge has two or more interfaces.
An address is assigned to an bridge member interface and
some offload flags are set.
Another interface has no address and has no any offload flag.
XXX pullup-[78]
To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 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.156 src/sys/net/if_bridge.c:1.157
--- src/sys/net/if_bridge.c:1.156 Fri May 25 04:40:27 2018
+++ src/sys/net/if_bridge.c Fri Sep 14 11:05:09 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bridge.c,v 1.156 2018/05/25 04:40:27 ozaki-r Exp $ */
+/* $NetBSD: if_bridge.c,v 1.157 2018/09/14 11:05:09 msaitoh Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.156 2018/05/25 04:40:27 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.157 2018/09/14 11:05:09 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_bridge_ipf.h"
@@ -1395,11 +1395,6 @@ bridge_enqueue(struct bridge_softc *sc,
int len, error;
short mflags;
- /*
- * Clear any in-bound checksum flags for this packet.
- */
- m->m_pkthdr.csum_flags = 0;
-
if (runfilt) {
if (pfil_run_hooks(sc->sc_if.if_pfil, &m,
dst_ifp, PFIL_OUT) != 0) {
@@ -1768,6 +1763,11 @@ bridge_forward(struct bridge_softc *sc,
bridge_release_member(sc, bif, &psref);
+ /*
+ * Clear any in-bound checksum flags for this packet.
+ */
+ m->m_pkthdr.csum_flags = 0;
+
ACQUIRE_GLOBAL_LOCKS();
bridge_enqueue(sc, dst_if, m, 1);
RELEASE_GLOBAL_LOCKS();
@@ -1978,6 +1978,12 @@ bridge_broadcast(struct bridge_softc *sc
sc->sc_if.if_oerrors++;
goto next;
}
+
+ /*
+ * Clear any in-bound checksum flags for this packet.
+ */
+ m->m_pkthdr.csum_flags = 0;
+
ACQUIRE_GLOBAL_LOCKS();
bridge_enqueue(sc, dst_if, mc, 1);
RELEASE_GLOBAL_LOCKS();