diff --git a/test/unit/tcp/tcp_helper.c b/test/unit/tcp/tcp_helper.c index fc7e67f8..aa7c84a9 100644 --- a/test/unit/tcp/tcp_helper.c +++ b/test/unit/tcp/tcp_helper.c @@ -141,9 +141,18 @@ void tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port) { + u32_t iss; + /* @todo: are these all states? */ /* @todo: remove from previous list */ pcb->state = state; + + iss = tcp_next_iss(pcb); + pcb->snd_wl2 = iss; + pcb->snd_nxt = iss; + pcb->lastack = iss; + pcb->snd_lbb = iss; + if (state == ESTABLISHED) { TCP_REG(&tcp_active_pcbs, pcb); pcb->local_ip.addr = local_ip->addr; diff --git a/test/unit/tcp/test_tcp.c b/test/unit/tcp/test_tcp.c index 81953466..1e5ef03d 100644 --- a/test/unit/tcp/test_tcp.c +++ b/test/unit/tcp/test_tcp.c @@ -418,7 +418,6 @@ START_TEST(test_tcp_fast_rexmit_wraparound) tcp_ticks = SEQNO1 - ISS; pcb = test_tcp_new_counters_pcb(&counters); EXPECT_RET(pcb != NULL); - EXPECT(pcb->lastack == SEQNO1); tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); pcb->mss = TCP_MSS; /* disable initial congestion window (we don't send a SYN here...) */ @@ -517,7 +516,6 @@ START_TEST(test_tcp_rto_rexmit_wraparound) tcp_ticks = SEQNO1 - tcp_next_iss(NULL); pcb = test_tcp_new_counters_pcb(&counters); EXPECT_RET(pcb != NULL); - EXPECT(pcb->lastack == SEQNO1); tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); pcb->mss = TCP_MSS; /* disable initial congestion window (we don't send a SYN here...) */