diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 1f42eeda..95065834 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -835,9 +835,9 @@ tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags) #endif /* LWIP_WND_SCALE */ } #if LWIP_TCP_TIMESTAMPS - if ((pcb->flags & TF_TIMESTAMP)) { - /* Make sure the timestamp option is only included in data segments if we - agreed about it with the remote host. */ + if ((pcb->flags & TF_TIMESTAMP) || ((flags & TCP_SYN) && (pcb->state != SYN_RCVD))) { + /* The timestamp option is only included in SYN packets, + * and in data segments if we agreed about it with the remote host. */ optflags |= TF_SEG_OPTS_TS; } #endif /* LWIP_TCP_TIMESTAMPS */