Commit 805dddad authored by Andrei Vagin's avatar Andrei Vagin

netlink: add nla_get_s32()

This function was added into libnl3 recently,
but we have to support old versions of this library.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent b79267b5
...@@ -11,6 +11,8 @@ extern int do_rtnl_req(int nl, void *req, int size, ...@@ -11,6 +11,8 @@ extern int do_rtnl_req(int nl, void *req, int size,
extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, extern int addattr_l(struct nlmsghdr *n, int maxlen, int type,
const void *data, int alen); const void *data, int alen);
extern int32_t nla_get_s32(const struct nlattr *nla);
#define NLMSG_TAIL(nmsg) \ #define NLMSG_TAIL(nmsg) \
((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len))) ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
......
...@@ -219,3 +219,8 @@ int __wrap_nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], ...@@ -219,3 +219,8 @@ int __wrap_nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[],
return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen), return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen),
nlmsg_attrlen(nlh, hdrlen), policy); nlmsg_attrlen(nlh, hdrlen), policy);
} }
int32_t nla_get_s32(const struct nlattr *nla)
{
return *(const int32_t *) nla_data(nla);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment