From 39e84aa6f7c4b6b70149abfa7e786dc0c893caf5 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Wed, 30 Oct 2013 13:43:15 +0100 Subject: [PATCH] Fix compilation on 32-bit platforms --- src/ra.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.25.1