From 64a351cbe0c54f6918e483dc972dfcc3e83efc40 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Tue, 30 Jan 2018 17:35:40 -0600 Subject: [PATCH] tcp_out: remove CHECKSUM_GEN_TCP case from tcp_send_empty_ack CHECKSUM_GEN_TCP support was moved to tcp_output_control_segment so we can remove usage of tcphdr and the extra set of #if/#endif This fixes https://travis-ci.org/yarrick/lwip-merged/builds/335348098 --- src/core/tcp_out.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 35acd79e..f0116a52 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -1880,15 +1880,13 @@ tcp_send_empty_ack(struct tcp_pcb *pcb) err_t err; struct pbuf *p; u8_t optlen = 0; -#if CHECKSUM_GEN_TCP || LWIP_TCP_TIMESTAMPS || LWIP_TCP_SACK_OUT - struct tcp_hdr *tcphdr; #if LWIP_TCP_TIMESTAMPS || LWIP_TCP_SACK_OUT + struct tcp_hdr *tcphdr; u32_t *opts; #if LWIP_TCP_SACK_OUT u8_t num_sacks; #endif /* LWIP_TCP_SACK_OUT */ #endif /* LWIP_TCP_TIMESTAMPS || LWIP_TCP_SACK_OUT */ -#endif /* CHECKSUM_GEN_TCP || LWIP_TCP_TIMESTAMPS || LWIP_TCP_SACK_OUT */ #if LWIP_TCP_TIMESTAMPS if (pcb->flags & TF_TIMESTAMP) { @@ -1911,13 +1909,11 @@ tcp_send_empty_ack(struct tcp_pcb *pcb) return ERR_BUF; } -#if CHECKSUM_GEN_TCP || LWIP_TCP_TIMESTAMPS || LWIP_TCP_SACK_OUT - tcphdr = (struct tcp_hdr *)p->payload; #if LWIP_TCP_TIMESTAMPS || LWIP_TCP_SACK_OUT + tcphdr = (struct tcp_hdr *)p->payload; /* cast through void* to get rid of alignment warnings */ opts = (u32_t *)(void *)(tcphdr + 1); #endif /* LWIP_TCP_TIMESTAMPS || LWIP_TCP_SACK_OUT */ -#endif /* CHECKSUM_GEN_TCP || LWIP_TCP_TIMESTAMPS || LWIP_TCP_SACK_OUT */ LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));