From 103b5a760fd1c6320d71b70bca12777df0f8be9c Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 1 Mar 2010 19:05:52 +0000 Subject: [PATCH] tcp_connect: send timestamp-option only if (pcb->flags & TF_TIMESTAMP) != NULL (same as for passive open) --- src/core/tcp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index c8ac2ad3..f86c704f 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -658,11 +658,13 @@ tcp_connect(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port, pcb->connected = connected; #endif /* LWIP_CALLBACK_API */ + /* Send a SYN together with the MSS option. */ ret = tcp_enqueue(pcb, NULL, 0, TCP_SYN, 0, TF_SEG_OPTS_MSS #if LWIP_TCP_TIMESTAMPS - | TF_SEG_OPTS_TS -#endif - ); + /* and maybe include the TIMESTAMP option */ + | (pcb->flags & TF_TIMESTAMP ? TF_SEG_OPTS_TS : 0) +#endif /* LWIP_TCP_TIMESTAMPS */ + ); if (ret == ERR_OK) { /* SYN segment was enqueued, changed the pcbs state now */ pcb->state = SYN_SENT;