mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 01:20:12 +01:00
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:
parent
494b3d82c1
commit
413c1e3fa0
1 changed files with 8 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue