From: Joe Hershberger Date: Mon, 5 Nov 2012 06:13:45 +0000 (+0000) Subject: net: Fix endianness bug in link-local X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=65b0db831e7b179879968d860fd5caa907cf6565;p=u-boot.git net: Fix endianness bug in link-local The ip is stored in network order, so we can't test it in host order. Signed-off-by: Joe Hershberger Reviewed-by: Kim Phillips --- diff --git a/net/link_local.c b/net/link_local.c index d52f13adb4..1ba796ebdf 100644 --- a/net/link_local.c +++ b/net/link_local.c @@ -103,7 +103,7 @@ static void configure_wait(void) void link_local_start(void) { ip = getenv_IPaddr("llipaddr"); - if (ip != 0 && (ip & IN_CLASSB_NET) != LINKLOCAL_ADDR) { + if (ip != 0 && (ntohl(ip) & IN_CLASSB_NET) != LINKLOCAL_ADDR) { puts("invalid link address"); net_set_state(NETLOOP_FAIL); return;