summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-08-07 14:53:26 +0200
committerElliott Hughes <enh@google.com>2020-03-10 14:45:42 -0700
commit8bdf14986a1baee1d44724cc66bc24c55418ebf5 (patch)
tree82b7b4803c95496ac081c3cd4c4504698f017564
parent173d924eceaa33fe7f731dfc692dd1e1cace80f3 (diff)
downloadlibnl-android-mainline-11.0.0_r40.tar.gz
Kernel 5.2 is adding stricter checking for netlink messages. In particular, for certain API it checks now that NLA_F_NESTED flag is set for nested attributes ([1]). Do like libmnl, which always adds this flag ([2]). So we should do that as well. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b424e432e770d6dd572765459d5b6a96a19c5286 [2] https://git.netfilter.org/libmnl/tree/src/attr.c?id=5937dfcb0185f5cb9cf275992ea701ec4e619d9c#n535 Bug: https://issuetracker.google.com/150744338 Test: treehugger Change-Id: I9012d820ed72b13d4562e144c48bc7003d621f09
-rw-r--r--lib/attr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/attr.c b/lib/attr.c
index bdf3c0fa..a76a2842 100644
--- a/lib/attr.c
+++ b/lib/attr.c
@@ -796,7 +796,7 @@ struct nlattr *nla_nest_start(struct nl_msg *msg, int attrtype)
{
struct nlattr *start = (struct nlattr *) nlmsg_tail(msg->nm_nlh);
- if (nla_put(msg, attrtype, 0, NULL) < 0)
+ if (nla_put(msg, NLA_F_NESTED | attrtype, 0, NULL) < 0)
return NULL;
NL_DBG(2, "msg %p: attr <%p> %d: starting nesting\n",