From: Petr Machata Date: Mon, 13 Jan 2020 14:16:28 +0000 (+0100) Subject: libnetlink: parse_rtattr_nested should allow NLA_F_NESTED flag X-Git-Tag: v5.6.0~22^2~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0da4cfaa5d57a0329357a256eb9e92020e1fcd07;p=thirdparty%2Fiproute2.git libnetlink: parse_rtattr_nested should allow NLA_F_NESTED flag 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(). The ETS code uses nla_nest_start() where possible, so it does not work with the current iproute2 code. Have libnetlink catch up by admitting the flag in the attribute. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Signed-off-by: David Ahern --- diff --git a/include/libnetlink.h b/include/libnetlink.h index 8ebdc6d3d..e27516f76 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)))