0
0
mirror of https://github.com/openwrt/packages.git synced 2025-02-14 13:48:04 +00:00
packages/net/wsdd2/patches/010-gcc14.patch
Rosen Penev de15108160 wsdd2: fix compilation with GCC14 and 64-bit
struct msghdr under musl uses padding ints for 64-bit, which means we
can't direct initialize like this. Switch to initializing each member
explicitly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-01 20:58:26 -07:00

20 lines
527 B
Diff

--- a/wsdd2.c
+++ b/wsdd2.c
@@ -543,7 +543,15 @@ static int netlink_recv(struct endpoint
char buf[PAGE_SIZE];
struct sockaddr_nl sa;
struct iovec iov = { buf, sizeof buf };
- struct msghdr msg = { &sa, sizeof sa, &iov, 1, NULL, 0, 0 };
+ struct msghdr msg = {
+ .msg_name = &sa,
+ .msg_namelen = sizeof(sa),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ .msg_control = NULL,
+ .msg_controllen = 0,
+ .msg_flags = 0,
+ };
ssize_t msglen = recvmsg(ep->sock, &msg, 0);
DEBUG(2, W, "%s: %zd bytes", __func__, msglen);