|
From: | hongchengyan |
Subject: | [lwip-devel] [bug #53273] IPv6 link-local address generation for non-ethernet type netif does not convert byte order |
Date: | Sat, 3 Mar 2018 09:29:23 -0500 (EST) |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36 |
URL: <http://savannah.nongnu.org/bugs/?53273> Summary: IPv6 link-local address generation for non-ethernet type netif does not convert byte order Project: lwIP - A Lightweight TCP/IP stack Submitted by: yanhc Submitted on: Sat 03 Mar 2018 02:29:21 PM UTC Category: IPv6 Severity: 3 - Normal Item Group: Faulty Behaviour Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None lwIP version: 2.0.2 _______________________________________________________ Details: netif_create_ip6_linklocal_address in netif.c does not convert byte order for non-ethernet type netif. I found this problem in x86 platform which is little endian. I add the lwip_htonl conversion in the following codes. addr_index = 3; for (i = 0; (i < 8) && (i < netif->hwaddr_len); i++) { if (i == 4) { addr_index--; } ip_2_ip6(&netif->ip6_addr[0])->addr[addr_index] |= lwip_htonl( ((u32_t)(netif->hwaddr[netif->hwaddr_len - i - 1])) << (8 * (i & 0x03)) ); } I have checked the latest 2.0.3. This problem is still there. _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?53273> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |