diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netlink.h | 3 | ||||
| -rw-r--r-- | include/linux/rtnetlink.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 0602eaffbad2..16af86e4743a 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -73,7 +73,8 @@ struct nlmsghdr #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) -#define NLMSG_OK(nlh,len) ((len) > 0 && (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ +#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ + (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ (nlh)->nlmsg_len <= (len)) #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 366eae3b4fc3..4f949964bb9b 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -73,7 +73,8 @@ struct rtattr #define RTA_ALIGNTO 4 #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) ) -#define RTA_OK(rta,len) ((len) > 0 && (rta)->rta_len >= sizeof(struct rtattr) && \ +#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \ + (rta)->rta_len >= sizeof(struct rtattr) && \ (rta)->rta_len <= (len)) #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \ (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len))) |
