aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2023-07-23 16:58:42 +0000
committerMarius Strobl <marius@FreeBSD.org>2023-07-26 11:14:22 +0000
commit8a0308722372a3ac6a94967ae4fe3123842309e2 (patch)
treec5f1164bf276c312f024905560383d9287028c8b
parente82d7b2952afaf9625a3d7b05d03c43c1d3e7d9c (diff)
downloadsrc-8a0308722372a3ac6a94967ae4fe3123842309e2.tar.gz
src-8a0308722372a3ac6a94967ae4fe3123842309e2.zip
gif(4): Assert that gif_output() isn't called for EtherIP
With the current implementation of if_bridge(4), bridge_enqueue() calls gif_transmit() only. Ensure it stays that way so that the expectations in both drivers are either met or changed accordingly. PR: 227450
-rw-r--r--sys/net/if_gif.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 5fa7664780c1..a4ac7243dbf7 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -407,6 +407,9 @@ gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
{
uint32_t af;
+ KASSERT(ifp->if_bridge == NULL,
+ ("%s: unexpectedly called with bridge attached", __func__));
+
if (dst->sa_family == AF_UNSPEC)
memcpy(&af, dst->sa_data, sizeof(af));
else