summaryrefslogtreecommitdiff
path: root/src/platform
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-07-23 10:32:07 +0200
committerThomas Haller <thaller@redhat.com>2019-07-23 14:43:50 +0200
commit7811d1c187b7140e31b2c0145e4d3097c7e38750 (patch)
treef7f5eb27b45f43a147a67de7ffd7f48c1e56fb8b /src/platform
parentbe1727be1f93bf181c04e0a742196be154026905 (diff)
downloadNetworkManager-7811d1c187b7140e31b2c0145e4d3097c7e38750.tar.gz
platform/netlink: mark nested netlink attribute with 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]). Note that libnl3 does not ever set this flag, and since our netlink implementation is copied from there, certain netlink messages are now rejected as invalid. On the other hand, libmnl always adds this flag ([2]). So we should do that as well. In particular, this affects the WireGuard netlink API causing request from NetworkManager to be rejected ([3]). [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 [3] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/212 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/210
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/nm-netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platform/nm-netlink.c b/src/platform/nm-netlink.c
index fae62fec35..da009d01c1 100644
--- a/src/platform/nm-netlink.c
+++ b/src/platform/nm-netlink.c
@@ -509,7 +509,7 @@ 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;
return start;