mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-28 19:18:32 +08:00
Move struct ip4_addr2 and corresponding copy macros from ip4_addr.h to prot/etharp.h where they belong
Also rename struct not to clash with IP4_ADDR2 macro definition, and rework copy macros to contain a source/dest direction
This commit is contained in:
@@ -465,11 +465,11 @@ autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr)
|
||||
struct eth_addr netifaddr;
|
||||
ETHADDR16_COPY(netifaddr.addr, netif->hwaddr);
|
||||
|
||||
/* Copy struct ip4_addr2 to aligned ip4_addr, to support compilers without
|
||||
/* Copy struct ip4_addr_wordaligned to aligned ip4_addr, to support compilers without
|
||||
* structure packing (not using structure copy which breaks strict-aliasing rules).
|
||||
*/
|
||||
IPADDR2_COPY(&sipaddr, &hdr->sipaddr);
|
||||
IPADDR2_COPY(&dipaddr, &hdr->dipaddr);
|
||||
IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&sipaddr, &hdr->sipaddr);
|
||||
IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&dipaddr, &hdr->dipaddr);
|
||||
|
||||
if (autoip->state == AUTOIP_STATE_PROBING) {
|
||||
/* RFC 3927 Section 2.2.1:
|
||||
|
||||
@@ -671,10 +671,10 @@ etharp_input(struct pbuf *p, struct netif *netif)
|
||||
autoip_arp_reply(netif, hdr);
|
||||
#endif /* LWIP_AUTOIP */
|
||||
|
||||
/* Copy struct ip4_addr2 to aligned ip4_addr, to support compilers without
|
||||
/* Copy struct ip4_addr_wordaligned to aligned ip4_addr, to support compilers without
|
||||
* structure packing (not using structure copy which breaks strict-aliasing rules). */
|
||||
IPADDR2_COPY(&sipaddr, &hdr->sipaddr);
|
||||
IPADDR2_COPY(&dipaddr, &hdr->dipaddr);
|
||||
IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&sipaddr, &hdr->sipaddr);
|
||||
IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&dipaddr, &hdr->dipaddr);
|
||||
|
||||
/* this interface is not configured? */
|
||||
if (ip4_addr_isany_val(*netif_ip4_addr(netif))) {
|
||||
@@ -1133,10 +1133,10 @@ etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr,
|
||||
/* Write the ARP MAC-Addresses */
|
||||
ETHADDR16_COPY(&hdr->shwaddr, hwsrc_addr);
|
||||
ETHADDR16_COPY(&hdr->dhwaddr, hwdst_addr);
|
||||
/* Copy struct ip4_addr2 to aligned ip4_addr, to support compilers without
|
||||
/* Copy struct ip4_addr_wordaligned to aligned ip4_addr, to support compilers without
|
||||
* structure packing. */
|
||||
IPADDR2_COPY(&hdr->sipaddr, ipsrc_addr);
|
||||
IPADDR2_COPY(&hdr->dipaddr, ipdst_addr);
|
||||
IPADDR_WORDALIGNED_COPY_FROM_IP4_ADDR_T(&hdr->sipaddr, ipsrc_addr);
|
||||
IPADDR_WORDALIGNED_COPY_FROM_IP4_ADDR_T(&hdr->dipaddr, ipdst_addr);
|
||||
|
||||
hdr->hwtype = PP_HTONS(HWTYPE_ETHERNET);
|
||||
hdr->proto = PP_HTONS(ETHTYPE_IP);
|
||||
|
||||
Reference in New Issue
Block a user