rename NLMSG_OK macro we have included to avoid name collision.

This commit is contained in:
gardners 2015-12-26 20:28:43 +10:30
parent ef0a8a9b57
commit e7cd17b607

View File

@ -1167,8 +1167,7 @@ static int interface_unregister(const char *name,
return 0;
}
#undef NLSMSG_OK
#define NLMSG_OK(nlh,len) ((int)(len) >= (int)sizeof(struct nlmsghdr) && \
#define NLMSG_OK_OPENWRTSAFE(nlh,len) ((int)(len) >= (int)sizeof(struct nlmsghdr) && \
(int)(nlh)->nlmsg_len >= (int)sizeof(struct nlmsghdr) && \
(int)(nlh)->nlmsg_len <= (int)(len))
@ -1184,7 +1183,7 @@ void netlink_poll(struct sched_ent *alarm)
struct nlmsghdr *nlh = (struct nlmsghdr *)buff;
for (nlh = (struct nlmsghdr *)buff;
(NLMSG_OK (nlh, (int)len))
(NLMSG_OK_OPENWRTSAFE (nlh, (int)len))
&& (nlh->nlmsg_type != NLMSG_DONE);
nlh = NLMSG_NEXT(nlh, len)){