Skip to content

Commit 69e9a12

Browse files
committed
tcp: keep closing sockets in CLOSING
F/1776
1 parent 50d575a commit 69e9a12

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/test/unit/unit_tests_proto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ START_TEST(test_tcp_sock_close_state_transitions)
621621

622622
ts->sock.tcp.state = TCP_CLOSING;
623623
ck_assert_int_eq(wolfIP_sock_close(&s, sd), -WOLFIP_EAGAIN);
624-
ck_assert_int_eq(ts->sock.tcp.state, TCP_TIME_WAIT);
624+
ck_assert_int_eq(ts->sock.tcp.state, TCP_CLOSING);
625625

626626
ts->sock.tcp.state = TCP_LISTEN;
627627
ck_assert_int_eq(wolfIP_sock_close(&s, sd), 0);

src/wolfip.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5082,7 +5082,6 @@ int wolfIP_sock_close(struct wolfIP *s, int sockfd)
50825082
tcp_ctrl_rto_start(ts, s->last_tick);
50835083
return -WOLFIP_EAGAIN;
50845084
} else if (ts->sock.tcp.state == TCP_CLOSING) {
5085-
ts->sock.tcp.state = TCP_TIME_WAIT;
50865085
return -WOLFIP_EAGAIN;
50875086
} else if (ts->sock.tcp.state == TCP_FIN_WAIT_1 ||
50885087
ts->sock.tcp.state == TCP_FIN_WAIT_2) {

0 commit comments

Comments
 (0)