]> git.decadent.org.uk Git - odhcp6c.git/commitdiff
Fix compilation on 32-bit platforms
authorSteven Barth <steven@midlink.org>
Wed, 30 Oct 2013 12:43:15 +0000 (13:43 +0100)
committerSteven Barth <steven@midlink.org>
Wed, 30 Oct 2013 12:43:15 +0000 (13:43 +0100)
src/ra.c

index aa03ff4d3ab8f6235b38aa8f069c785d3486a10e..971a1723e84a4a05b9c966d1e406df1cae12492e 100644 (file)
--- a/src/ra.c
+++ b/src/ra.c
@@ -161,7 +161,8 @@ bool ra_link_up(void)
 
        do {
                read = recv(rtnl, &resp, sizeof(resp), MSG_DONTWAIT);
-               if (!NLMSG_OK(&resp.hdr, read) || resp.hdr.nlmsg_type != RTM_NEWLINK ||
+               if (read < 0 || !NLMSG_OK(&resp.hdr, (size_t)read) ||
+                               resp.hdr.nlmsg_type != RTM_NEWLINK ||
                                resp.msg.ifi_index != if_index)
                        continue;