summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-08-07 12:53:26 (GMT)
committerThomas Haller <thaller@redhat.com>2019-08-07 13:32:19 (GMT)
commit7de65a051fb37ece16f896a7385073274b77a133 (patch)
treebb95694ad3ccf570323974e4ad6f96ca3292c962
parente5961ffaf11956cf2ade4e72ac694dd29a986bdd (diff)
downloadlibnl-7de65a051fb37ece16f896a7385073274b77a133.zip
libnl-7de65a051fb37ece16f896a7385073274b77a133.tar.gz
libnl-7de65a051fb37ece16f896a7385073274b77a133.tar.bz2
attr: mark nested attributes as NLA_F_NESTED
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
-rw-r--r--lib/attr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/attr.c b/lib/attr.c
index 1ddc007..a089e99 100644
--- a/lib/attr.c
+++ b/lib/attr.c
@@ -903,7 +903,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",