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.
This commit is contained in:
adamdunkels 2009-10-27 22:34:08 +00:00
parent 53d03aa924
commit 631af06c7c
2 changed files with 14 additions and 2 deletions

View file

@ -41,7 +41,7 @@
* *
* This file is part of the uIP TCP/IP stack. * 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_flags = UIP_POLL;
UIP_APPCALL(); UIP_APPCALL();
goto appsend; 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; goto drop;

View file

@ -41,7 +41,7 @@
* *
* This file is part of the uIP TCP/IP stack. * 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_flags = UIP_POLL;
UIP_APPCALL(); UIP_APPCALL();
goto appsend; 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; goto drop;
#endif /* UIP_TCP */ #endif /* UIP_TCP */