git: 8a0308722372 - main - gif(4): Assert that gif_output() isn't called for EtherIP
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 26 Jul 2023 11:28:59 UTC
The branch main has been updated by marius:
URL: https://cgit.FreeBSD.org/src/commit/?id=8a0308722372a3ac6a94967ae4fe3123842309e2
commit 8a0308722372a3ac6a94967ae4fe3123842309e2
Author: Marius Strobl <marius@FreeBSD.org>
AuthorDate: 2023-07-23 16:58:42 +0000
Commit: Marius Strobl <marius@FreeBSD.org>
CommitDate: 2023-07-26 11:14:22 +0000
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
---
sys/net/if_gif.c | 3 +++
1 file changed, 3 insertions(+)
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