diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-11-22 21:51:48 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-11-22 21:51:48 +0100 |
commit | bbe1f68ded15a3579d26d8c3f23e9c3941296193 (patch) | |
tree | 411e86b58fbbb08290e6aaa30ffc4b137080352d /src/attr.c | |
parent | ff4bacb058e3e084a1bf717bf5c5034e14f4ebea (diff) | |
download | libmnl-bbe1f68ded15a3579d26d8c3f23e9c3941296193.tar.gz libmnl-bbe1f68ded15a3579d26d8c3f23e9c3941296193.zip |
attr: add mnl_attr_nest_cancel()
This patch adds mnl_attr_nest_cancel() that allows to cancel the
current nest that we are building.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/attr.c')
-rw-r--r-- | src/attr.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -504,5 +504,18 @@ mnl_attr_nest_end(struct nlmsghdr *nlh, struct nlattr *start) } /** + * mnl_attr_nest_cancel - cancel an attribute nest + * \param nlh pointer to the netlink message + * \param start pointer to the attribute nest returned by mnl_attr_nest_start() + * + * This function updates the attribute header that identifies the nest. + */ +EXPORT_SYMBOL void +mnl_attr_nest_cancel(struct nlmsghdr *nlh, struct nlattr *start) +{ + nlh->nlmsg_len -= mnl_nlmsg_get_payload_tail(nlh) - (void *)start; +} + +/** * @} */ |