netlink: add NLMSG_OK definition
Change-Id: I4ab4cabd1e6950802eda360d972d2ef5cea30da2 Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
80c90399e6
commit
9a9d76744b
|
@ -136,6 +136,9 @@
|
|||
((n) -= NLMSG_ALIGN((hdr)->nlmsg_len), \
|
||||
(FAR struct nlmsghdr*) \
|
||||
(((FAR char*)(hdr)) + NLMSG_ALIGN((hdr)->nlmsg_len)))
|
||||
#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
|
||||
(nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
|
||||
(nlh)->nlmsg_len <= (len))
|
||||
#define NLMSG_PAYLOAD(hdr, len) \
|
||||
((hdr)->nlmsg_len - NLMSG_SPACE((len)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue