diff mbox series

[2/2] arpd.c: Use names for struct msghdr initialisation

Message ID 20240712191209.31324-2-contact@hacktivis.me (mailing list archive)
State Not Applicable
Headers show
Series [1/2] libnetlink.h: Add <endian.h> for htobe64 | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Haelwenn (lanodan) Monnier July 12, 2024, 7:12 p.m. UTC
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@hacktivis.me>
---
 misc/arpd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

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;