summaryrefslogtreecommitdiffstats
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2006-03-26 20:52:47 +0000
committerthompsa <thompsa@FreeBSD.org>2006-03-26 20:52:47 +0000
commit8bb7fbe5d697a9a37edc2923b26eaf94e84bf2b6 (patch)
tree90d70a536f37452711829fff3d589fd18ac23941 /sys/net/if_bridge.c
parent831de5e2f57ec48f650385a83922e2cc70d08ee8 (diff)
downloadFreeBSD-src-8bb7fbe5d697a9a37edc2923b26eaf94e84bf2b6.zip
FreeBSD-src-8bb7fbe5d697a9a37edc2923b26eaf94e84bf2b6.tar.gz
Assert that the mbuf is not shared to ensure problems like the last commit are
not reintroduced.
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 2adf062..a583442 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -2589,6 +2589,9 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir)
snap = 0;
error = -1; /* Default error if not error == 0 */
+ /* we may return with the IP fields swapped, ensure its not shared */
+ KASSERT(M_WRITABLE(*mp), ("%s: modifying a shared mbuf", __func__));
+
if (pfil_bridge == 0 && pfil_member == 0 && pfil_ipfw == 0)
return 0; /* filtering is disabled */
OpenPOWER on IntegriCloud