diff --git a/src/core/ipv4/icmp.c b/src/core/ipv4/icmp.c index d6348d89..e60e4481 100644 --- a/src/core/ipv4/icmp.c +++ b/src/core/ipv4/icmp.c @@ -236,7 +236,7 @@ icmp_input(struct pbuf *p, struct netif *inp) MIB2_STATS_INC(mib2.icmpoutechoreps); /* send an ICMP packet */ - ret = ip4_output_if(p, src, IP_HDRINCL, + ret = ip4_output_if(p, src, LWIP_IP_HDRINCL, ICMP_TTL, 0, IP_PROTO_ICMP, inp); if (ret != ERR_OK) { LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ip_output_if returned an error: %s\n", lwip_strerr(ret))); diff --git a/src/core/ipv4/igmp.c b/src/core/ipv4/igmp.c index 50c5d9d0..089a7611 100644 --- a/src/core/ipv4/igmp.c +++ b/src/core/ipv4/igmp.c @@ -765,8 +765,8 @@ igmp_delaying_member(struct igmp_group *group, u8_t maxresp) * the IP address of the outgoing network interface is filled in as source address. * * @param p the packet to send (p->payload points to the data, e.g. next - protocol header; if dest == IP_HDRINCL, p already includes an IP - header and p->payload points to that IP header) + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IP header and p->payload points to that IP header) * @param src the source IP address to send from (if src == IP_ADDR_ANY, the * IP address of the netif used to send is used as source address) * @param dest the destination IP address to send the packet to diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c index 1bdc30f5..0dba2dc2 100644 --- a/src/core/ipv4/ip4.c +++ b/src/core/ipv4/ip4.c @@ -716,12 +716,12 @@ ip4_input(struct pbuf *p, struct netif *inp) * the IP header and calculates the IP header checksum. If the source * IP address is NULL, the IP address of the outgoing network * interface is filled in as source address. - * If the destination IP address is IP_HDRINCL, p is assumed to already + * If the destination IP address is LWIP_IP_HDRINCL, p is assumed to already * include an IP header and p->payload points to it instead of the data. * * @param p the packet to send (p->payload points to the data, e.g. next - protocol header; if dest == IP_HDRINCL, p already includes an IP - header and p->payload points to that IP header) + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IP header and p->payload points to that IP header) * @param src the source IP address to send from (if src == IP_ADDR_ANY, the * IP address of the netif used to send is used as source address) * @param dest the destination IP address to send the packet to @@ -758,7 +758,7 @@ ip4_output_if_opt(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, { #endif /* IP_OPTIONS_SEND */ const ip4_addr_t *src_used = src; - if (dest != IP_HDRINCL) { + if (dest != LWIP_IP_HDRINCL) { if (ip4_addr_isany(src)) { src_used = netif_ip4_addr(netif); } @@ -806,7 +806,7 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d MIB2_STATS_INC(mib2.ipoutrequests); /* Should the IP header be generated or is it already included in p? */ - if (dest != IP_HDRINCL) { + if (dest != LWIP_IP_HDRINCL) { u16_t ip_hlen = IP_HLEN; #if IP_OPTIONS_SEND u16_t optlen_aligned = 0; @@ -951,8 +951,8 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d * interface and calls upon ip_output_if to do the actual work. * * @param p the packet to send (p->payload points to the data, e.g. next - protocol header; if dest == IP_HDRINCL, p already includes an IP - header and p->payload points to that IP header) + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IP header and p->payload points to that IP header) * @param src the source IP address to send from (if src == IP_ADDR_ANY, the * IP address of the netif used to send is used as source address) * @param dest the destination IP address to send the packet to @@ -986,8 +986,8 @@ ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, * before calling ip_output_if. * * @param p the packet to send (p->payload points to the data, e.g. next - protocol header; if dest == IP_HDRINCL, p already includes an IP - header and p->payload points to that IP header) + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IP header and p->payload points to that IP header) * @param src the source IP address to send from (if src == IP_ADDR_ANY, the * IP address of the netif used to send is used as source address) * @param dest the destination IP address to send the packet to diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c index 3f604dfd..650e5af7 100644 --- a/src/core/ipv6/ip6.c +++ b/src/core/ipv6/ip6.c @@ -781,11 +781,11 @@ ip6_input_cleanup: * used as source (usually during network startup). If the source IPv6 address it * IP6_ADDR_ANY, the most appropriate IPv6 address of the outgoing network * interface is filled in as source address. If the destination IPv6 address is - * IP_HDRINCL, p is assumed to already include an IPv6 header and p->payload points - * to it instead of the data. + * LWIP_IP_HDRINCL, p is assumed to already include an IPv6 header and + * p->payload points to it instead of the data. * * @param p the packet to send (p->payload points to the data, e.g. next - protocol header; if dest == IP_HDRINCL, p already includes an + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IPv6 header and p->payload points to that IPv6 header) * @param src the source IPv6 address to send from (if src == IP6_ADDR_ANY, an * IP address of the netif is selected and used as source address. @@ -805,7 +805,7 @@ ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, u8_t nexth, struct netif *netif) { const ip6_addr_t *src_used = src; - if (dest != IP_HDRINCL) { + if (dest != LWIP_IP_HDRINCL) { if (src != NULL && ip6_addr_isany(src)) { src = ip_2_ip6(ip6_select_source_address(netif, dest)); if ((src == NULL) || ip6_addr_isany(src)) { @@ -834,7 +834,7 @@ ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); /* Should the IPv6 header be generated or is it already included in p? */ - if (dest != IP_HDRINCL) { + if (dest != LWIP_IP_HDRINCL) { /* generate IPv6 header */ if (pbuf_header(p, IP6_HLEN)) { LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_output: not enough room for IPv6 header in pbuf\n")); @@ -907,7 +907,7 @@ ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, * interface and calls upon ip6_output_if to do the actual work. * * @param p the packet to send (p->payload points to the data, e.g. next - protocol header; if dest == IP_HDRINCL, p already includes an + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IPv6 header and p->payload points to that IPv6 header) * @param src the source IPv6 address to send from (if src == IP6_ADDR_ANY, an * IP address of the netif is selected and used as source address. @@ -930,7 +930,7 @@ ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); - if (dest != IP_HDRINCL) { + if (dest != LWIP_IP_HDRINCL) { netif = ip6_route(src, dest); } else { /* IP header included in p, read addresses. */ @@ -963,7 +963,7 @@ ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, * before calling ip6_output_if. * * @param p the packet to send (p->payload points to the data, e.g. next - protocol header; if dest == IP_HDRINCL, p already includes an + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an IPv6 header and p->payload points to that IPv6 header) * @param src the source IPv6 address to send from (if src == IP6_ADDR_ANY, an * IP address of the netif is selected and used as source address. @@ -989,7 +989,7 @@ ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); - if (dest != IP_HDRINCL) { + if (dest != LWIP_IP_HDRINCL) { netif = ip6_route(src, dest); } else { /* IP header included in p, read addresses. */ diff --git a/src/include/lwip/ip.h b/src/include/lwip/ip.h index 772a4c0c..09394320 100644 --- a/src/include/lwip/ip.h +++ b/src/include/lwip/ip.h @@ -63,10 +63,7 @@ extern "C" { /* This is passed as the destination address to ip_output_if (not to ip_output), meaning that an IP header already is constructed in the pbuf. This is used when TCP retransmits. */ -#ifdef IP_HDRINCL -#undef IP_HDRINCL -#endif /* IP_HDRINCL */ -#define IP_HDRINCL NULL +#define LWIP_IP_HDRINCL NULL /** pbufs passed to IP must have a ref-count of 1 as their payload pointer gets altered as the packet is passed down the stack */