Skip to contentSkip to conversation

libnetlink: Fix wrong netlink header placement

PATCH Applied Ido Schimmel 4 participants 4 messages Dec 8, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libnetlink: Fix wrong netlink header placement

The netlink header must be first in the netlink message, so move it there.

Fixes fee4a56f0191 ("Update kernel headers")
---
 include/libnetlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/libnetlink.h +1 -1
index 4d9696efa253..c91a22314548 100644
@@ -38,9 +38,9 @@ struct nlmsg_chain {
 };
 
 struct ipstats_req {
+	struct nlmsghdr nlh;
 	struct if_stats_msg ifsm;
 	char buf[128];
-	struct nlmsghdr nlh;
 };
 
 extern int rcvbuf;
Signature · 1 line
2.37.3
#2 lore raw
In reply to Ido Schimmel
Quoted 14 lines · Ido Schimmel

The netlink header must be first in the netlink message, so move it there.

Fixes fee4a56f0191 ("Update kernel headers")
---
 include/libnetlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/libnetlink.h +0 -0
index 4d9696efa253..c91a22314548 100644

include/libnetlink.h struct nlmsg_chain { · line 46

Quoted 10 lines
include/libnetlink.h +1 -1
@@ -38,9 +38,9 @@ struct nlmsg_chain {
 };
 
 struct ipstats_req {
+	struct nlmsghdr nlh;
 	struct if_stats_msg ifsm;
 	char buf[128];
-	struct nlmsghdr nlh;
 };
 
 extern int rcvbuf;

thanks for noticing this. Must have been stale diff on the branch when I was looking into the flex-array problem.

#3 lore raw
In reply to Ido Schimmel
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 8 lines · On Thu, 8 Dec 2022 16:38:16 +0200 you wrote:

The netlink header must be first in the netlink message, so move it there.

Fixes fee4a56f0191 ("Update kernel headers")
---
 include/libnetlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [iproute2-next] libnetlink: Fix wrong netlink header placement

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=fa94a9792155

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html