diff mbox series

[RFC,1/3] libnetlink: parse_rtattr_nested should allow NLA_F_NESTED flag

Message ID 20191120130519.17702-1-petrm@mellanox.com
State RFC
Delegated to: David Miller
Headers show
Series [RFC,1/3] libnetlink: parse_rtattr_nested should allow NLA_F_NESTED flag | expand

Commit Message

Petr Machata Nov. 20, 2019, 1:05 p.m. UTC
In kernel commit 8cb081746c03 ("netlink: make validation more configurable
for future strictness"), Linux started implicitly flagging nests with
NLA_F_NESTED, unless the nest is created with nla_nest_start_noflag(). Have
libnetlink catch up by admitting the flag in the attribute.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 include/libnetlink.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/libnetlink.h b/include/libnetlink.h
index 8ebdc6d3..e27516f7 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -173,7 +173,8 @@  int rta_nest_end(struct rtattr *rta, struct rtattr *nest);
 				    RTA_ALIGN((rta)->rta_len)))
 
 #define parse_rtattr_nested(tb, max, rta) \
-	(parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
+	(parse_rtattr_flags((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta), \
+			    NLA_F_NESTED))
 
 #define parse_rtattr_one_nested(type, rta) \
 	(parse_rtattr_one(type, RTA_DATA(rta), RTA_PAYLOAD(rta)))