[PATCH inarp 3/3] Avoid signed and unsigned comparison

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue Jun 7 06:20:13 AEST 2016


From: Patrick Williams <patrick at stwcx.xyz>

The 'NLMSG_OK' macro use a _u32 struct entry for comparison but
the length from recv is signed.  Passing the signed type directly
into the macro causes a signed and unsigned comparison warning.

Fixes openbmc/inarp#3.

Signed-off-by: Patrick Williams <patrick at stwcx.xyz>
---
 inarp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/inarp.c b/inarp.c
index 08a0c30..4b4f03e 100644
--- a/inarp.c
+++ b/inarp.c
@@ -360,7 +360,9 @@ static void netlink_recv(struct inarp_ctx *inarp)
 		return;
 	}
 
-	for_each_nlmsg(buf, nlmsg, len)
+	size_t len_unsigned = (size_t)len;
+
+	for_each_nlmsg(buf, nlmsg, len_unsigned)
 		netlink_nlmsg(inarp, nlmsg);
 }
 
-- 
2.8.3




More information about the openbmc mailing list