From e05a96550fe34338fb2261a767a9291c84197d30 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 25 Apr 2018 21:17:47 +0200 Subject: [PATCH] etharp: fix bogus ifdef regions (after separating etharp and ethernet) --- src/core/ipv4/etharp.c | 11 ++++------- src/include/lwip/etharp.h | 11 +++++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/core/ipv4/etharp.c b/src/core/ipv4/etharp.c index ffff8081..f8e05598 100644 --- a/src/core/ipv4/etharp.c +++ b/src/core/ipv4/etharp.c @@ -45,7 +45,7 @@ #include "lwip/opt.h" -#if LWIP_ARP || LWIP_ETHERNET +#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */ #include "lwip/etharp.h" #include "lwip/stats.h" @@ -61,8 +61,6 @@ #include LWIP_HOOK_FILENAME #endif -#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */ - /** Re-request a used ARP entry 1 minute before it would expire to prevent * breaking a steadily used connection because the ARP entry timed out. */ #define ARP_AGE_REREQUEST_USED_UNICAST (ARP_MAXAGE - 30) @@ -126,8 +124,8 @@ static u8_t etharp_cached_entry; #endif /* LWIP_NETIF_HWADDRHINT */ -/* Some checks, instead of etharp_init(): */ -#if (LWIP_ARP && (ARP_TABLE_SIZE > 0x7f)) +/* Check for maximum ARP_TABLE_SIZE */ +#if (ARP_TABLE_SIZE > 0x7f) #error "ARP_TABLE_SIZE must fit in an s8_t, you have to reduce it in your lwipopts.h" #endif @@ -1201,6 +1199,5 @@ etharp_request(struct netif *netif, const ip4_addr_t *ipaddr) LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n")); return etharp_request_dst(netif, ipaddr, ðbroadcast); } -#endif /* LWIP_IPV4 && LWIP_ARP */ -#endif /* LWIP_ARP || LWIP_ETHERNET */ +#endif /* LWIP_IPV4 && LWIP_ARP */ diff --git a/src/include/lwip/etharp.h b/src/include/lwip/etharp.h index 7080a19d..b0a0a373 100644 --- a/src/include/lwip/etharp.h +++ b/src/include/lwip/etharp.h @@ -52,14 +52,14 @@ #include "lwip/ip4.h" #include "lwip/prot/ethernet.h" -#ifdef __cplusplus -extern "C" { -#endif - #if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */ #include "lwip/prot/etharp.h" +#ifdef __cplusplus +extern "C" { +#endif + /** 1 seconds period */ #define ARP_TMR_INTERVAL 1000 @@ -93,14 +93,13 @@ err_t etharp_add_static_entry(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr err_t etharp_remove_static_entry(const ip4_addr_t *ipaddr); #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ -#endif /* LWIP_IPV4 && LWIP_ARP */ - void etharp_input(struct pbuf *p, struct netif *netif); #ifdef __cplusplus } #endif +#endif /* LWIP_IPV4 && LWIP_ARP */ #endif /* LWIP_ARP || LWIP_ETHERNET */ #endif /* LWIP_HDR_NETIF_ETHARP_H */