From: Steven Barth Date: Wed, 30 Oct 2013 12:43:15 +0000 (+0100) Subject: Fix compilation on 32-bit platforms X-Git-Tag: debian/1.1+git20160131-1~112 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=39e84aa6f7c4b6b70149abfa7e786dc0c893caf5;p=odhcp6c.git Fix compilation on 32-bit platforms --- diff --git a/src/ra.c b/src/ra.c index aa03ff4..971a172 100644 --- 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;