fix compilation of ip_canforward on 8-/16-bit platforms (where constants are 16-bit and thus cannot be left-shifted by 24)

This commit is contained in:
goldsimon 2011-11-23 09:09:22 +01:00
parent 08b497faea
commit d1fa13ed52

View File

@ -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;
}