summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/transport_demuxer.go
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2018-08-27 15:28:38 -0700
committerShentubot <shentubot@google.com>2018-08-27 15:29:55 -0700
commit0923bcf06bffe0216cd685f49e83a07201d48cc3 (patch)
treebe364ad4d00bf8952af309a1b4ed870392bf82ad /pkg/tcpip/stack/transport_demuxer.go
parent0b3bfe2ea30d491a6533f8ee74eb6e3cea707f06 (diff)
Add various statistics
PiperOrigin-RevId: 210442599 Change-Id: I9498351f461dc69c77b7f815d526c5693bec8e4a
Diffstat (limited to 'pkg/tcpip/stack/transport_demuxer.go')
-rw-r--r--pkg/tcpip/stack/transport_demuxer.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/transport_demuxer.go b/pkg/tcpip/stack/transport_demuxer.go
index dbaa9c829..862afa693 100644
--- a/pkg/tcpip/stack/transport_demuxer.go
+++ b/pkg/tcpip/stack/transport_demuxer.go
@@ -19,6 +19,7 @@ import (
"gvisor.googlesource.com/gvisor/pkg/tcpip"
"gvisor.googlesource.com/gvisor/pkg/tcpip/buffer"
+ "gvisor.googlesource.com/gvisor/pkg/tcpip/header"
)
type protocolIDs struct {
@@ -111,6 +112,10 @@ func (d *transportDemuxer) deliverPacket(r *Route, protocol tcpip.TransportProto
// Fail if we didn't find one.
if ep == nil {
+ // UDP packet could not be delivered to an unknown destination port.
+ if protocol == header.UDPProtocolNumber {
+ r.Stats().UDP.UnknownPortErrors.Increment()
+ }
return false
}