netns_ifaddrs: fix integer comparisons

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2021-09-03 12:11:43 +02:00
parent a15c360949
commit 49bdee73fc
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -31,7 +31,7 @@
#define __NETLINK_ALIGN(len) (((len) + 3) & ~3)
#define __NLMSG_OK(nlh, end) \
((char *)(end) - (char *)(nlh) >= sizeof(struct nlmsghdr))
((size_t)((char *)(end) - (char *)(nlh)) >= sizeof(struct nlmsghdr))
#define __NLMSG_NEXT(nlh) \
(struct nlmsghdr *)((char *)(nlh) + __NETLINK_ALIGN((nlh)->nlmsg_len))
@ -50,7 +50,7 @@
(struct rtattr *)((char *)(rta) + __NETLINK_ALIGN((rta)->rta_len))
#define __RTA_OK(nlh, end) \
((char *)(end) - (char *)(rta) >= sizeof(struct rtattr))
((size_t)((char *)(end) - (char *)(rta)) >= sizeof(struct rtattr))
#define __NLMSG_RTAOK(rta, nlh) __RTA_OK(rta, __NLMSG_DATAEND(nlh))