summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/network/ipv4
diff options
context:
space:
mode:
authorNick Brown <nickbrow@google.com>2021-10-27 10:03:11 -0700
committergVisor bot <gvisor-bot@google.com>2021-10-27 10:06:55 -0700
commit22a6a37079c69129d10abfbdd6fdfdf7a9d4a68d (patch)
tree6c19c8844d062db058f9fe02840ed4c69387314d /pkg/tcpip/network/ipv4
parent7b8f19dc76a9fecbf4d2e5f43a47c6d47d53e100 (diff)
Record counts of packets with unknown L3/L4 numbers
Previously, we recorded a single aggregated count. These per-protocol counts can help us debug field issues when frames are dropped for this reason. PiperOrigin-RevId: 405913911
Diffstat (limited to 'pkg/tcpip/network/ipv4')
-rw-r--r--pkg/tcpip/network/ipv4/stats_test.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/pkg/tcpip/network/ipv4/stats_test.go b/pkg/tcpip/network/ipv4/stats_test.go
index d1f9e3cf5..15a056d4b 100644
--- a/pkg/tcpip/network/ipv4/stats_test.go
+++ b/pkg/tcpip/network/ipv4/stats_test.go
@@ -87,13 +87,22 @@ func TestMultiCounterStatsInitialization(t *testing.T) {
// expected to be bound by a MultiCounterStat.
refStack := s.Stats()
refEP := ep.stats.localStats
- if err := testutil.ValidateMultiCounterStats(reflect.ValueOf(&ep.stats.ip).Elem(), []reflect.Value{reflect.ValueOf(&refEP.IP).Elem(), reflect.ValueOf(&refStack.IP).Elem()}); err != nil {
+ if err := testutil.ValidateMultiCounterStats(reflect.ValueOf(&ep.stats.ip).Elem(), []reflect.Value{reflect.ValueOf(&refEP.IP).Elem(), reflect.ValueOf(&refStack.IP).Elem()}, testutil.ValidateMultiCounterStatsOptions{
+ ExpectMultiCounterStat: true,
+ ExpectMultiIntegralStatCounterMap: false,
+ }); err != nil {
t.Error(err)
}
- if err := testutil.ValidateMultiCounterStats(reflect.ValueOf(&ep.stats.icmp).Elem(), []reflect.Value{reflect.ValueOf(&refEP.ICMP).Elem(), reflect.ValueOf(&refStack.ICMP.V4).Elem()}); err != nil {
+ if err := testutil.ValidateMultiCounterStats(reflect.ValueOf(&ep.stats.icmp).Elem(), []reflect.Value{reflect.ValueOf(&refEP.ICMP).Elem(), reflect.ValueOf(&refStack.ICMP.V4).Elem()}, testutil.ValidateMultiCounterStatsOptions{
+ ExpectMultiCounterStat: true,
+ ExpectMultiIntegralStatCounterMap: false,
+ }); err != nil {
t.Error(err)
}
- if err := testutil.ValidateMultiCounterStats(reflect.ValueOf(&ep.stats.igmp).Elem(), []reflect.Value{reflect.ValueOf(&refEP.IGMP).Elem(), reflect.ValueOf(&refStack.IGMP).Elem()}); err != nil {
+ if err := testutil.ValidateMultiCounterStats(reflect.ValueOf(&ep.stats.igmp).Elem(), []reflect.Value{reflect.ValueOf(&refEP.IGMP).Elem(), reflect.ValueOf(&refStack.IGMP).Elem()}, testutil.ValidateMultiCounterStatsOptions{
+ ExpectMultiCounterStat: true,
+ ExpectMultiIntegralStatCounterMap: false,
+ }); err != nil {
t.Error(err)
}
}