Newer generic netlink APIs (e.g. wireguard) require this to be able to parse
nested attributes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
{
struct nlattr *start = (struct nlattr *) nlmsg_tail(msg->nm_nlh);
{
struct nlattr *start = (struct nlattr *) nlmsg_tail(msg->nm_nlh);
- if (nla_put(msg, attrtype, 0, NULL) < 0)
+ if (nla_put(msg, attrtype | NLA_F_NESTED, 0, NULL) < 0)
return NULL;
return start;
return NULL;
return start;
+#define NLA_F_NESTED (1 << 15)
+
/**
* Netlink error message
* @ingroup msg
/**
* Netlink error message
* @ingroup msg