git: d8413a1c3ba2 - main - ifnet: Fix build without BPF
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 06 Feb 2025 18:32:37 UTC
The branch main has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=d8413a1c3ba235a79ae6b8cc35767a861855c7e2
commit d8413a1c3ba235a79ae6b8cc35767a861855c7e2
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-02-06 18:32:05 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-02-06 18:32:05 +0000
ifnet: Fix build without BPF
The newly introduced function bpf_ifdetach() is only available when
device bpf is enabled.
Fixes: 1ed9b381d470 ifnet: Detach BPF descriptors on interface vmove event
---
sys/net/if.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/net/if.c b/sys/net/if.c
index 283da94e7601..ce0c3d5c0616 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1262,10 +1262,12 @@ finish_vnet_shutdown:
static void
if_vmove(struct ifnet *ifp, struct vnet *new_vnet)
{
+#ifdef DEV_BPF
/*
* Detach BPF file descriptors from its interface.
*/
bpf_ifdetach(ifp);
+#endif
/*
* Detach from current vnet, but preserve LLADDR info, do not