diff --git a/core/net/uip6.c b/core/net/uip6.c index e79486ff1..7f51ce4e9 100644 --- a/core/net/uip6.c +++ b/core/net/uip6.c @@ -1833,8 +1833,12 @@ uip_process(uint8_t flag) UIP_TCP_BUF->seqno[2] != uip_connr->rcv_nxt[2] || UIP_TCP_BUF->seqno[3] != uip_connr->rcv_nxt[3])) { - if(UIP_TCP_BUF->flags & TCP_SYN) { - goto tcp_send_synack; + if((UIP_TCP_BUF->flags & TCP_SYN)) { + if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_RCVD) { + goto tcp_send_synack; + } else if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) { + goto tcp_send_syn; + } } goto tcp_send_ack; }