aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenlei Huang <zlei@FreeBSD.org>2025-01-25 10:31:55 +0000
committerZhenlei Huang <zlei@FreeBSD.org>2025-01-25 10:31:55 +0000
commit7bb9ba61d35703c8a819c3745b8a2b1feb56923d (patch)
treef4230f1a034f6e51ed80f9e4f70ac70d09a684e3
parent46a9fb7287f41eedf321d81a68a826f231d11bfe (diff)
ip6addrctl(8): Use static initializer
MFC after: 1 week
-rw-r--r--usr.sbin/ip6addrctl/ip6addrctl.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/usr.sbin/ip6addrctl/ip6addrctl.c b/usr.sbin/ip6addrctl/ip6addrctl.c
index 13413fefa8ce..146b2f1ad3e0 100644
--- a/usr.sbin/ip6addrctl/ip6addrctl.c
+++ b/usr.sbin/ip6addrctl/ip6addrctl.c
@@ -58,7 +58,7 @@ struct policyqueue {
struct in6_addrpolicy pc_policy;
};
TAILQ_HEAD(policyhead, policyqueue);
-static struct policyhead policyhead;
+static struct policyhead policyhead = TAILQ_HEAD_INITIALIZER(policyhead);
static void usage(void) __dead2;
static void get_policy(void);
@@ -75,8 +75,6 @@ static void flush_policy(void);
int
main(int argc, char *argv[])
{
- TAILQ_INIT(&policyhead);
-
if (argc == 1 || strcasecmp(argv[1], "show") == 0) {
get_policy();
dump_policy();