From f2c7e9c939ed612172b0e026aad12b1652d4ca17 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 16 Jan 2016 09:41:42 +0800 Subject: [PATCH] raw: Remove unnecessary #if guard around PCB_ISIPV6() calls PCB_ISIPV6() macro is well defined for all cases (LWIP_IPV4 && LWIP_IPV6, LWIP_IPV4 only and LWIP_IPV6 only), thus remove the unnecessary #if guard around PCB_ISIPV6() calls. Signed-off-by: Axel Lin --- src/core/raw.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/core/raw.c b/src/core/raw.c index 1ebc0aca..2ba7dfa1 100644 --- a/src/core/raw.c +++ b/src/core/raw.c @@ -112,9 +112,7 @@ raw_input(struct pbuf *p, struct netif *inp) #if IP_SOF_BROADCAST_RECV /* broadcast filter? */ if ((ip_get_option(pcb, SOF_BROADCAST) || !ip_addr_isbroadcast(ip_current_dest_addr(), ip_current_netif())) -#if LWIP_IPV6 || PCB_ISIPV6(pcb) -#endif /* LWIP_IPV6 */ ) #endif /* IP_SOF_BROADCAST_RECV */ { @@ -248,14 +246,7 @@ raw_sendto(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr) LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE, ("raw_sendto\n")); - header_size = ( -#if LWIP_IPV4 && LWIP_IPV6 - PCB_ISIPV6(pcb) ? IP6_HLEN : IP_HLEN); -#elif LWIP_IPV4 - IP_HLEN); -#else - IP6_HLEN); -#endif + header_size = PCB_ISIPV6(pcb) ? IP6_HLEN : IP_HLEN; /* not enough space to add an IP header to first pbuf in given p chain? */ if (pbuf_header(p, header_size)) { @@ -293,9 +284,7 @@ raw_sendto(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr) } #if IP_SOF_BROADCAST -#if LWIP_IPV6 if (!PCB_ISIPV6(pcb)) -#endif /* LWIP_IPV6 */ { /* broadcast filter? */ if (!ip_get_option(pcb, SOF_BROADCAST) && ip_addr_isbroadcast(ipaddr, netif)) {