summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libmnl/files/0001-examples-genl-fix-wrong-attribute-size.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/libmnl/files/0001-examples-genl-fix-wrong-attribute-size.patch')
-rw-r--r--meta/recipes-extended/libmnl/files/0001-examples-genl-fix-wrong-attribute-size.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/meta/recipes-extended/libmnl/files/0001-examples-genl-fix-wrong-attribute-size.patch b/meta/recipes-extended/libmnl/files/0001-examples-genl-fix-wrong-attribute-size.patch
new file mode 100644
index 0000000000..9e06abb9a4
--- /dev/null
+++ b/meta/recipes-extended/libmnl/files/0001-examples-genl-fix-wrong-attribute-size.patch
@@ -0,0 +1,44 @@
1From 67ad7abf1fe888c650f9e8ed326a499e1456285c Mon Sep 17 00:00:00 2001
2From: Florian Westphal <fw@strlen.de>
3Date: Mon, 15 Sep 2025 14:40:30 +0200
4Subject: [PATCH] examples: genl: fix wrong attribute size
5
6This example no longer works on more recent kernels:
7
8genl-family-get
9error: Invalid argument
10
11dmesg says:
12netlink: 'genl-family-get': attribute type 1 has an invalid length.
13
14Fix this and also zero out the reserved field in the genl header,
15while not validated yet for dumps this could change.
16
17Upstream-Status: Backport [https://git.netfilter.org/libmnl/patch/?id=54dea548d796653534645c6e3c8577eaf7d77411]
18
19Reported-by: Divyanshu Rathore <Divyanshu.Rathore@bmwtechworks.in>
20Signed-off-by: Florian Westphal <fw@strlen.de>
21(cherry picked from commit 54dea548d796653534645c6e3c8577eaf7d77411)
22Signed-off-by: Divyanshu Rathore <divyanshu.rathore@bmwtechworks.in>
23---
24 examples/genl/genl-family-get.c | 3 ++-
25 1 file changed, 2 insertions(+), 1 deletion(-)
26
27diff --git a/examples/genl/genl-family-get.c b/examples/genl/genl-family-get.c
28index ba8de12..0c20067 100644
29--- a/examples/genl/genl-family-get.c
30+++ b/examples/genl/genl-family-get.c
31@@ -199,8 +199,9 @@ int main(int argc, char *argv[])
32 genl = mnl_nlmsg_put_extra_header(nlh, sizeof(struct genlmsghdr));
33 genl->cmd = CTRL_CMD_GETFAMILY;
34 genl->version = 1;
35+ genl->reserved = 0;
36
37- mnl_attr_put_u32(nlh, CTRL_ATTR_FAMILY_ID, GENL_ID_CTRL);
38+ mnl_attr_put_u16(nlh, CTRL_ATTR_FAMILY_ID, GENL_ID_CTRL);
39 if (argc >= 2)
40 mnl_attr_put_strz(nlh, CTRL_ATTR_FAMILY_NAME, argv[1]);
41 else
42--
432.34.1
44