git: 0b4c4833ee3e - main - ifnet: Eliminate unnecessary synchronization of the interface index in the link layer address
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Jun 2025 10:01:58 UTC
The branch main has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=0b4c4833ee3eab0ce46b3bdbf054bca4b6bb7429
commit 0b4c4833ee3eab0ce46b3bdbf054bca4b6bb7429
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-06-24 10:01:18 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-06-24 10:01:18 +0000
ifnet: Eliminate unnecessary synchronization of the interface index in the link layer address
Change 80e60e236d85 made the if_index global, and for the whole lifecycle
of an interface its index never changes, then there is no need to
synchronize the interface index in the link layer address when moving
interfaces from one vnet to another.
No functional change intended.
Reviewed by: glebius
Fixes: 80e60e236d85 ifnet: make if_index global
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D50975
---
sys/net/if.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/sys/net/if.c b/sys/net/if.c
index 2363c48a24da..9048fcb0a16a 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -930,21 +930,6 @@ if_attach_internal(struct ifnet *ifp, bool vmove)
}
#endif
}
-#ifdef VIMAGE
- else {
- /*
- * Update the interface index in the link layer address
- * of the interface.
- */
- for (ifa = ifp->if_addr; ifa != NULL;
- ifa = CK_STAILQ_NEXT(ifa, ifa_link)) {
- if (ifa->ifa_addr->sa_family == AF_LINK) {
- sdl = (struct sockaddr_dl *)ifa->ifa_addr;
- sdl->sdl_index = ifp->if_index;
- }
- }
- }
-#endif
if (domain_init_status >= 2)
if_attachdomain1(ifp);