From 65b0db831e7b179879968d860fd5caa907cf6565 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Mon, 5 Nov 2012 06:13:45 +0000 Subject: [PATCH] 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 --- 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 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; -- 2.39.5