-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wsdd2: fix msghdr initialization patch
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 1be722c52a386d5e617cb245c5311ae79f77ff7d Mon Sep 17 00:00:00 2001 | ||
From: CrazyMax <1951866+crazy-max@users.noreply.github.com> | ||
Date: Fri, 27 Dec 2024 15:40:27 +0100 | ||
Subject: [PATCH] fix msghdr initialization | ||
|
||
--- | ||
wsdd2.c | 11 ++++++++++- | ||
1 file changed, 10 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/wsdd2.c b/wsdd2.c | ||
index 4f91f6e..4d31544 100644 | ||
--- a/wsdd2.c | ||
+++ b/wsdd2.c | ||
@@ -543,7 +543,16 @@ static int netlink_recv(struct endpoint *ep) | ||
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, | ||
+ .__pad2 = 0 | ||
+ }; | ||
ssize_t msglen = recvmsg(ep->sock, &msg, 0); | ||
|
||
DEBUG(2, W, "%s: %zd bytes", __func__, msglen); | ||
-- |