platform/netlink: add NLA_NEST_END() helper macro

It's upper case like NLA_PUT(), which also does a goto nla_put_failure;
on error. Otherwise, the upper case naming is a bit odd.
This commit is contained in:
Thomas Haller 2022-08-08 17:37:45 +02:00
parent 494b3d82c1
commit 413c1e3fa0
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -354,6 +354,14 @@ void nla_nest_cancel(struct nl_msg *msg, const struct nlattr *attr);
struct nlattr *nla_nest_start(struct nl_msg *msg, int attrtype);
int nla_nest_end(struct nl_msg *msg, struct nlattr *start);
#define NLA_NEST_END(msg, nest_start) \
G_STMT_START \
{ \
if (nla_nest_end((msg), (nest_start)) < 0) \
goto nla_put_failure; \
} \
G_STMT_END
int nla_parse(struct nlattr *tb[],
int maxtype,
struct nlattr *head,