git: 4a253ccbe813 - stable/14 - lo: Use new KPI to assign the first loop interface
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 05 Jul 2024 15:14:26 UTC
The branch stable/14 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=4a253ccbe8135afdbb5c6552e140aab6eae35ef9
commit 4a253ccbe8135afdbb5c6552e140aab6eae35ef9
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-06-26 10:00:37 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-07-05 15:11:51 +0000
lo: Use new KPI to assign the first loop interface
While here remove a pointless static local variable lo_cloner.
No functional change intended.
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45728
(cherry picked from commit 2cb7605a2415a1c0dd35374a88f815ef00e31de9)
---
sys/net/if_loop.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index e135acef18bb..5558fe5a71ab 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -95,13 +95,9 @@ static int looutput(struct ifnet *ifp, struct mbuf *m,
const struct sockaddr *dst, struct route *ro);
VNET_DEFINE(struct ifnet *, loif); /* Used externally */
-
-#ifdef VIMAGE
VNET_DEFINE_STATIC(struct if_clone *, lo_cloner);
#define V_lo_cloner VNET(lo_cloner)
-#endif
-static struct if_clone *lo_cloner;
static const char loname[] = "lo";
static int
@@ -143,8 +139,6 @@ lo_clone_create(struct if_clone *ifc, char *name, size_t len,
ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6;
if_attach(ifp);
bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
- if (V_loif == NULL)
- V_loif = ifp;
*ifpp = ifp;
return (0);
@@ -158,12 +152,9 @@ vnet_loif_init(const void *unused __unused)
.destroy_f = lo_clone_destroy,
.flags = IFC_F_AUTOUNIT,
};
- lo_cloner = ifc_attach_cloner(loname, &req);
-#ifdef VIMAGE
- V_lo_cloner = lo_cloner;
-#endif
+ V_lo_cloner = ifc_attach_cloner(loname, &req);
struct ifc_data ifd = { .unit = 0 };
- ifc_create_ifp(loname, &ifd, NULL);
+ ifc_create_ifp(loname, &ifd, &V_loif);
}
VNET_SYSINIT(vnet_loif_init, SI_SUB_PSEUDO, SI_ORDER_ANY,
vnet_loif_init, NULL);