Module Name:    src
Committed By:   jdolecek
Date:           Fri Mar 27 16:47:00 UTC 2020

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

Log Message:
replace the conditional m_pullup() on start of bridge_output() with
a KASSERT(), to make it clear no mbuf manipulation is ever done here

the condition should never trigger, this always runs after ether_output()
M_PREPEND()s ether_header


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 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.169 src/sys/net/if_bridge.c:1.170
--- src/sys/net/if_bridge.c:1.169	Tue Mar 24 13:30:54 2020
+++ src/sys/net/if_bridge.c	Fri Mar 27 16:47:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.169 2020/03/24 13:30:54 jdolecek Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.170 2020/03/27 16:47:00 jdolecek Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.169 2020/03/24 13:30:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.170 2020/03/27 16:47:00 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -1496,11 +1496,7 @@ bridge_output(struct ifnet *ifp, struct 
 	 * IFEF_MPSAFE here.
 	 */
 
-	if (m->m_len < ETHER_HDR_LEN) {
-		m = m_pullup(m, ETHER_HDR_LEN);
-		if (m == NULL)
-			return 0;
-	}
+	KASSERT(m->m_len >= ETHER_HDR_LEN);
 
 	eh = mtod(m, struct ether_header *);
 	sc = ifp->if_bridge;

Reply via email to