From 1dff9aea622458c88cecb254bf75bdfc562ca2f3 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 28 Mar 2012 11:06:52 +0200 Subject: [PATCH] fixed the fix for bug #35945 (SYN packet should provide the recv MSS not the send MSS) if TCP_CALCULATE_EFF_SEND_MSS==0 --- src/core/tcp_out.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index f79ffdbc..74c4900d 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -1071,7 +1071,13 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb) packets, so ignore it here */ opts = (u32_t *)(void *)(seg->tcphdr + 1); if (seg->flags & TF_SEG_OPTS_MSS) { - *opts = TCP_BUILD_MSS_OPTION(tcp_eff_send_mss(TCP_MSS, &pcb->local_ip, &pcb->remote_ip, PCB_ISIPV6(pcb))); + u16_t mss; +#if TCP_CALCULATE_EFF_SEND_MSS + mss = tcp_eff_send_mss(TCP_MSS, &pcb->local_ip, &pcb->remote_ip, PCB_ISIPV6(pcb)); +#else /* TCP_CALCULATE_EFF_SEND_MSS */ + mss = TCP_MSS; +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + *opts = TCP_BUILD_MSS_OPTION(mss); opts += 1; } #if LWIP_TCP_TIMESTAMPS