* etharp.c (etharp_arp_input): Fix type aliasing problem copying ip address.

This commit is contained in:
jifl 2008-10-03 14:47:33 +00:00
parent 1d2804d6a2
commit 06df1647e1
2 changed files with 4 additions and 1 deletions

View File

@ -51,6 +51,9 @@ HISTORY
++ Bugfixes:
2008-10-03 David Woodhouse, Jonathan Larmour
* etharp.c (etharp_arp_input): Fix type aliasing problem copying ip address.
2008-10-02 Jonathan Larmour
* dns.c: Hard-code structure sizes, to avoid issues on some compilers where
padding is included.

View File

@ -705,7 +705,7 @@ etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p)
hdr->opcode = htons(ARP_REPLY);
hdr->dipaddr = hdr->sipaddr;
hdr->sipaddr = *(struct ip_addr2 *)&netif->ip_addr;
SMEMCPY(&hdr->sipaddr, &netif->ip_addr, sizeof(hdr->sipaddr));
LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
(netif->hwaddr_len == ETHARP_HWADDR_LEN));