git: ab72295c6584 - stable/13 - ip6addrctl(8): Use static initializer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 03 Feb 2025 12:28:17 UTC
The branch stable/13 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=ab72295c6584035094a6e5e90deada0bf2e608c5
commit ab72295c6584035094a6e5e90deada0bf2e608c5
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-01-25 10:31:55 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-02-03 12:27:05 +0000
ip6addrctl(8): Use static initializer
MFC after: 1 week
(cherry picked from commit 7bb9ba61d35703c8a819c3745b8a2b1feb56923d)
(cherry picked from commit db9074ea54c095d22eb0dec681eae163079dd41f)
---
usr.sbin/ip6addrctl/ip6addrctl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/usr.sbin/ip6addrctl/ip6addrctl.c b/usr.sbin/ip6addrctl/ip6addrctl.c
index b2921747715b..8cb4f05cc0a8 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);
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();