From 06df1647e17d16c5b40355b06edc534bc9510a71 Mon Sep 17 00:00:00 2001 From: jifl Date: Fri, 3 Oct 2008 14:47:33 +0000 Subject: [PATCH] * etharp.c (etharp_arp_input): Fix type aliasing problem copying ip address. --- CHANGELOG | 3 +++ src/netif/etharp.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 0ed73a00..e177599b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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. diff --git a/src/netif/etharp.c b/src/netif/etharp.c index f5a6473d..ab8586c3 100644 --- a/src/netif/etharp.c +++ b/src/netif/etharp.c @@ -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));