From d1fa13ed52fdc232a850420ef84f4553b0a4f599 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 23 Nov 2011 09:09:22 +0100 Subject: [PATCH] fix compilation of ip_canforward on 8-/16-bit platforms (where constants are 16-bit and thus cannot be left-shifted by 24) --- src/core/ipv4/ip4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c index 73b17ea0..30c52d50 100644 --- a/src/core/ipv4/ip4.c +++ b/src/core/ipv4/ip4.c @@ -169,7 +169,7 @@ ip_canforward(struct pbuf *p) } if (IP_CLASSA(addr)) { u32_t net = addr & IP_CLASSA_NET; - if ((net == 0) || (net == (IP_LOOPBACKNET << IP_CLASSA_NSHIFT))) { + if ((net == 0) || (net == ((u32_t)IP_LOOPBACKNET << IP_CLASSA_NSHIFT))) { /* don't route loopback packets */ return 0; }