From 631af06c7c094e89855cb5b44cc5d247cacdbb03 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Tue, 27 Oct 2009 22:34:08 +0000 Subject: [PATCH] Bugfix: Active TCP connections in uIP are made by first setting up the TCP connection state, then poll uIP to send out the first SYN. Until now, however, the SYN was not sent as part of the poll, but at the first retransmission. This is now fixed. --- core/net/uip.c | 8 +++++++- core/net/uip6.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/net/uip.c b/core/net/uip.c index 74d470b33..2aa22ac9c 100644 --- a/core/net/uip.c +++ b/core/net/uip.c @@ -41,7 +41,7 @@ * * This file is part of the uIP TCP/IP stack. * - * $Id: uip.c,v 1.16 2009/10/18 22:03:44 adamdunkels Exp $ + * $Id: uip.c,v 1.17 2009/10/27 22:34:08 adamdunkels Exp $ * */ @@ -693,6 +693,12 @@ uip_process(u8_t flag) uip_flags = UIP_POLL; UIP_APPCALL(); goto appsend; +#if UIP_ACTIVE_OPEN + } else if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) { + /* In the SYN_SENT state, we retransmit out SYN. */ + UIP_TCP_BUF->flags = 0; + goto tcp_send_syn; +#endif /* UIP_ACTIVE_OPEN */ } goto drop; diff --git a/core/net/uip6.c b/core/net/uip6.c index f63cfe430..a9cb65ecc 100644 --- a/core/net/uip6.c +++ b/core/net/uip6.c @@ -41,7 +41,7 @@ * * This file is part of the uIP TCP/IP stack. * - * $Id: uip6.c,v 1.6 2009/05/19 11:54:50 nvt-se Exp $ + * $Id: uip6.c,v 1.7 2009/10/27 22:34:08 adamdunkels Exp $ * */ @@ -901,6 +901,12 @@ uip_process(u8_t flag) uip_flags = UIP_POLL; UIP_APPCALL(); goto appsend; +#if UIP_ACTIVE_OPEN + } else if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) { + /* In the SYN_SENT state, we retransmit out SYN. */ + UIP_TCP_BUF->flags = 0; + goto tcp_send_syn; +#endif /* UIP_ACTIVE_OPEN */ } goto drop; #endif /* UIP_TCP */