diff options
author | Jianfeng Tan <henry.tjf@antfin.com> | 2019-05-20 11:26:10 +0000 |
---|---|---|
committer | Jianfeng Tan <henry.tjf@antfin.com> | 2019-10-15 16:38:41 +0000 |
commit | d277bfba2702b319d8336b65429cf8775661ea2f (patch) | |
tree | 5f23548038554d51968d3ee4ec4ea7cb016c50dd /pkg/tcpip/transport/tcp/accept.go | |
parent | aee2c93366f451b9cc0a62430185749556fc3900 (diff) |
epsocket: support /proc/net/snmp
Netstack has its own stats, we use this to fill /proc/net/snmp.
Note that some metrics are not recorded in Netstack, which will be shown
as 0 in the proc file.
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>
Change-Id: Ie0089184507d16f49bc0057b4b0482094417ebe1
Diffstat (limited to 'pkg/tcpip/transport/tcp/accept.go')
-rw-r--r-- | pkg/tcpip/transport/tcp/accept.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/tcpip/transport/tcp/accept.go b/pkg/tcpip/transport/tcp/accept.go index 2b4c5c2f9..65c346046 100644 --- a/pkg/tcpip/transport/tcp/accept.go +++ b/pkg/tcpip/transport/tcp/accept.go @@ -297,10 +297,8 @@ func (l *listenContext) createEndpointAndPerformHandshake(s *segment, opts *head return nil, err } ep.mu.Lock() - if ep.state != StateEstablished { - ep.stack.Stats().TCP.CurrentEstablished.Increment() - ep.state = StateEstablished - } + ep.stack.Stats().TCP.CurrentEstablished.Increment() + ep.state = StateEstablished ep.mu.Unlock() // Update the receive window scaling. We can't do it before the |