2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

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: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Andrei Vagin
2016-12-17 06:31:21 +03:00
parent 6c41550ffd
commit 301f39a499
2 changed files with 7 additions and 0 deletions

View File

@@ -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,
const void *data, int alen);
extern int32_t nla_get_s32(const struct nlattr *nla);
#define NLMSG_TAIL(nmsg) \
((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))

View File

@@ -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),
nlmsg_attrlen(nlh, hdrlen), policy);
}
int32_t nla_get_s32(const struct nlattr *nla)
{
return *(const int32_t *) nla_data(nla);
}