From patchwork Mon Nov 5 16:13:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2] net: Fix endianness bug in link-local Date: Mon, 05 Nov 2012 06:13:45 -0000 From: Joe Hershberger X-Patchwork-Id: 197212 Message-Id: <1352132025-8151-1-git-send-email-joe.hershberger@ni.com> To: u-boot@lists.denx.de Cc: Joe Hershberger , Kim Phillips 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 --- Changes in v2: - Changed htonl() to ntohl() net/link_local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/link_local.c b/net/link_local.c index d52f13a..1ba796e 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;