[U-Boot] [PATCH] net: Fix endianness bug in link-local

Joe Hershberger joe.hershberger at ni.com
Fri Nov 2 04:05:54 CET 2012


The ip is stored in network order, so we can't test it in host order.

Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
---
 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..8a8f605 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 && (htonl(ip) & IN_CLASSB_NET) != LINKLOCAL_ADDR) {
 		puts("invalid link address");
 		net_set_state(NETLOOP_FAIL);
 		return;
-- 
1.7.11.5



More information about the U-Boot mailing list