diff options
author | Tamir Duberstein <tamird@google.com> | 2018-08-27 15:28:38 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-08-27 15:29:55 -0700 |
commit | 0923bcf06bffe0216cd685f49e83a07201d48cc3 (patch) | |
tree | be364ad4d00bf8952af309a1b4ed870392bf82ad /pkg/tcpip/network/ipv4 | |
parent | 0b3bfe2ea30d491a6533f8ee74eb6e3cea707f06 (diff) |
Add various statistics
PiperOrigin-RevId: 210442599
Change-Id: I9498351f461dc69c77b7f815d526c5693bec8e4a
Diffstat (limited to 'pkg/tcpip/network/ipv4')
-rw-r--r-- | pkg/tcpip/network/ipv4/ipv4.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/tcpip/network/ipv4/ipv4.go b/pkg/tcpip/network/ipv4/ipv4.go index e5db44b5d..e6b1f5128 100644 --- a/pkg/tcpip/network/ipv4/ipv4.go +++ b/pkg/tcpip/network/ipv4/ipv4.go @@ -121,6 +121,7 @@ func (e *endpoint) WritePacket(r *stack.Route, hdr *buffer.Prependable, payload DstAddr: r.RemoteAddress, }) ip.SetChecksum(^ip.CalculateChecksum()) + r.Stats().IP.PacketsSent.Increment() return e.linkEP.WritePacket(r, hdr, payload, ProtocolNumber) } @@ -153,6 +154,7 @@ func (e *endpoint) HandlePacket(r *stack.Route, vv *buffer.VectorisedView) { e.handleICMP(r, vv) return } + r.Stats().IP.PacketsDelivered.Increment() e.dispatcher.DeliverTransportPacket(r, p, vv) } |