Skip to content

Commit b5a31dc

Browse files
shrek-wangkartben
authored andcommitted
net: tcp: Move the CLOSED state to the front
In enum tcp_state {}, the CLOSED state was put at the last one. When we do Sequence & Ack validation, we will need to skip the CLOSED, LISTEN, SYNSENT states. It is easier for coding if we put the CLOSED to the front, e.g. if state > SYNSENT. And, in other OSes, the state sequence is normally defined like this. Signed-off-by: Shrek Wang <[email protected]>
1 parent dc7b6a0 commit b5a31dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/ip/tcp_private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ struct tcp_mss_option {
198198

199199
enum tcp_state {
200200
TCP_UNUSED = 0,
201+
TCP_CLOSED,
201202
TCP_LISTEN,
202203
TCP_SYN_SENT,
203204
TCP_SYN_RECEIVED,
@@ -207,8 +208,7 @@ enum tcp_state {
207208
TCP_CLOSE_WAIT,
208209
TCP_CLOSING,
209210
TCP_LAST_ACK,
210-
TCP_TIME_WAIT,
211-
TCP_CLOSED
211+
TCP_TIME_WAIT
212212
};
213213

214214
enum tcp_data_mode {

0 commit comments

Comments
 (0)