git: e2b6e11583eb - stable/14 - if_vxlan(4): Use static initializers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 03 Feb 2025 12:25:36 UTC
The branch stable/14 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=e2b6e11583eb13ee09a7cb0babc2a1d8f3bd952a
commit e2b6e11583eb13ee09a7cb0babc2a1d8f3bd952a
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-01-24 09:37:24 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-02-03 12:23:59 +0000
if_vxlan(4): Use static initializers
MFC after: 1 week
(cherry picked from commit 5e0dbbc238e2e935c68e293314a90f2ce6e6ef16)
---
sys/net/if_vxlan.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
index 0bbb3e0bcf9c..204fdc351df1 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -420,7 +420,8 @@ static struct mtx vxlan_list_mtx;
#define VXLAN_LIST_LOCK() mtx_lock(&vxlan_list_mtx)
#define VXLAN_LIST_UNLOCK() mtx_unlock(&vxlan_list_mtx)
-static LIST_HEAD(, vxlan_socket) vxlan_socket_list;
+static LIST_HEAD(, vxlan_socket) vxlan_socket_list =
+ LIST_HEAD_INITIALIZER(vxlan_socket_list);
static eventhandler_tag vxlan_ifdetach_event_tag;
@@ -3610,12 +3611,10 @@ vxlan_tunable_int(struct vxlan_softc *sc, const char *knob, int def)
static void
vxlan_ifdetach_event(void *arg __unused, struct ifnet *ifp)
{
- struct vxlan_softc_head list;
+ struct vxlan_softc_head list = LIST_HEAD_INITIALIZER(list);
struct vxlan_socket *vso;
struct vxlan_softc *sc, *tsc;
- LIST_INIT(&list);
-
if (ifp->if_flags & IFF_RENAMING)
return;
if ((ifp->if_flags & IFF_MULTICAST) == 0)
@@ -3643,7 +3642,6 @@ vxlan_load(void)
{
mtx_init(&vxlan_list_mtx, "vxlan list", NULL, MTX_DEF);
- LIST_INIT(&vxlan_socket_list);
vxlan_ifdetach_event_tag = EVENTHANDLER_REGISTER(ifnet_departure_event,
vxlan_ifdetach_event, NULL, EVENTHANDLER_PRI_ANY);