tcp: remove the hardcode in the definition of TCPF Macro
authorYafang Shao <laoar.shao@gmail.com>
Tue, 20 Feb 2018 13:28:31 +0000 (21:28 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Feb 2018 20:06:05 +0000 (15:06 -0500)
TCPF_ macro depends on the definition of TCP_ macro.
So it is better to define them with TCP_ marco.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tcp_states.h

index 50e78a74d0dfa957394e68da9aa636dad4b08a05..2875e169d7445e65b65110081215b5f62d6e911c 100644 (file)
@@ -32,21 +32,21 @@ enum {
 
 #define TCP_STATE_MASK 0xF
 
-#define TCP_ACTION_FIN (1 << 7)
+#define TCP_ACTION_FIN (1 << TCP_CLOSE)
 
 enum {
-       TCPF_ESTABLISHED = (1 << 1),
-       TCPF_SYN_SENT    = (1 << 2),
-       TCPF_SYN_RECV    = (1 << 3),
-       TCPF_FIN_WAIT1   = (1 << 4),
-       TCPF_FIN_WAIT2   = (1 << 5),
-       TCPF_TIME_WAIT   = (1 << 6),
-       TCPF_CLOSE       = (1 << 7),
-       TCPF_CLOSE_WAIT  = (1 << 8),
-       TCPF_LAST_ACK    = (1 << 9),
-       TCPF_LISTEN      = (1 << 10),
-       TCPF_CLOSING     = (1 << 11),
-       TCPF_NEW_SYN_RECV = (1 << 12),
+       TCPF_ESTABLISHED = (1 << TCP_ESTABLISHED),
+       TCPF_SYN_SENT    = (1 << TCP_SYN_SENT),
+       TCPF_SYN_RECV    = (1 << TCP_SYN_RECV),
+       TCPF_FIN_WAIT1   = (1 << TCP_FIN_WAIT1),
+       TCPF_FIN_WAIT2   = (1 << TCP_FIN_WAIT2),
+       TCPF_TIME_WAIT   = (1 << TCP_TIME_WAIT),
+       TCPF_CLOSE       = (1 << TCP_CLOSE),
+       TCPF_CLOSE_WAIT  = (1 << TCP_CLOSE_WAIT),
+       TCPF_LAST_ACK    = (1 << TCP_LAST_ACK),
+       TCPF_LISTEN      = (1 << TCP_LISTEN),
+       TCPF_CLOSING     = (1 << TCP_CLOSING),
+       TCPF_NEW_SYN_RECV = (1 << TCP_NEW_SYN_RECV),
 };
 
 #endif /* _LINUX_TCP_STATES_H */