raw: Fix build error

IP6_HLEN is only defined when LWIP_IPV6, IP_HLEN is only defined when LWIP_IPV4.
This fixes build error in !LWIP_IPV4 || !LWIP_IPV6 cases.

Fixes: f2c7e9c939 ("raw: Remove unnecessary #if guard around PCB_ISIPV6() calls")
Reported-by: Erik Ekman
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2016-01-18 22:46:35 +08:00 committed by Dirk Ziegelmeier
parent 1ee574944c
commit fe2cfe2dba

View File

@ -246,7 +246,14 @@ 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 = PCB_ISIPV6(pcb) ? IP6_HLEN : IP_HLEN;
header_size = (
#if LWIP_IPV4 && LWIP_IPV6
PCB_ISIPV6(pcb) ? IP6_HLEN : IP_HLEN);
#elif LWIP_IPV4
IP_HLEN);
#else
IP6_HLEN);
#endif
/* not enough space to add an IP header to first pbuf in given p chain? */
if (pbuf_header(p, header_size)) {