List of possible internal socket statuses from /proc

前端 未结 1 583
陌清茗
陌清茗 2020-12-13 10:07

I would like to know the possible values of st column in /proc/net/tcp. I think the st column equates to STATE column from netst

相关标签:
1条回答
  • 2020-12-13 10:58

    They should match to the enum in ./include/net/tcp_states.h in the linux kernel sources:

    enum {
        TCP_ESTABLISHED = 1,
        TCP_SYN_SENT,
        TCP_SYN_RECV,
        TCP_FIN_WAIT1,
        TCP_FIN_WAIT2,
        TCP_TIME_WAIT,
        TCP_CLOSE,
        TCP_CLOSE_WAIT,
        TCP_LAST_ACK,
        TCP_LISTEN,
        TCP_CLOSING,    /* Now a valid state */
    
        TCP_MAX_STATES  /* Leave at the end! */
    };
    

    As for your 2. question, are you really sure there's not an sshd listening on e.g. 0.0.0.0:22 ? If not, I suspect what you're seeing is related to v4-mapped-on-v6 sockets, see e.g. man 7 ipv6

    0 讨论(0)
提交回复
热议问题