X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=blobdiff_plain;f=src%2Fra.c;h=971a1723e84a4a05b9c966d1e406df1cae12492e;hp=aa03ff4d3ab8f6235b38aa8f069c785d3486a10e;hb=39e84aa6f7c4b6b70149abfa7e786dc0c893caf5;hpb=4a9de784477a0f0dbc04ff890e35adae02ee6e8b 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;