[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240712191209.31324-2-contact@hacktivis.me>
Date: Fri, 12 Jul 2024 21:12:09 +0200
From: "Haelwenn (lanodan) Monnier" <contact@...ktivis.me>
To: netdev@...r.kernel.org
Cc: "Haelwenn (lanodan) Monnier" <contact@...ktivis.me>
Subject: [PATCH 2/2] arpd.c: Use names for struct msghdr initialisation
Fixes the following compiler error which is due to padding elements
being present in musl (1.2.5), thankfully the struct element names
are part of POSIX.
arpd.c:442:3: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
442 | NULL, 0,
| ^~~~
Signed-off-by: Haelwenn (lanodan) Monnier <contact@...ktivis.me>
---
misc/arpd.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/misc/arpd.c b/misc/arpd.c
index 3185620..724d387 100644
--- a/misc/arpd.c
+++ b/misc/arpd.c
@@ -437,10 +437,13 @@ static void get_kern_msg(void)
struct iovec iov;
char buf[8192];
struct msghdr msg = {
- (void *)&nladdr, sizeof(nladdr),
- &iov, 1,
- NULL, 0,
- 0
+ .msg_name = (void *)&nladdr,
+ .msg_namelen = sizeof(nladdr),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ .msg_control = NULL,
+ .msg_controllen = 0,
+ .msg_flags = 0
};
iov.iov_base = buf;
--
2.44.2
Powered by blists - more mailing lists