0
0
mirror of https://github.com/openwrt/packages.git synced 2025-03-15 10:18:37 +00:00

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>
This commit is contained in:
Rosen Penev
2024-06-01 17:31:48 -07:00
parent c87b846cac
commit de15108160
2 changed files with 20 additions and 1 deletions
net/wsdd2

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wsdd2
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/Netgear/wsdd2.git

@ -0,0 +1,19 @@
--- 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);