Skip to content

Commit d52aaf9

Browse files
committed
Merge pull request #12883 from zsxsoft:master
PiperOrigin-RevId: 896665375
2 parents 1204348 + e04f994 commit d52aaf9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/sentry/socket/hostinet/stack.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@ func (s *Stack) Statistics(stat any, arg string) error {
320320
switch stat.(type) {
321321
case *inet.StatDev:
322322
if s.netDevFile == nil {
323-
return fmt.Errorf("/proc/net/dev is not opened for hostinet")
323+
return nil
324324
}
325325
rawLine = getLine(s.netDevFile, arg, false /* with no header */)
326326
case *inet.StatSNMPIP, *inet.StatSNMPICMP, *inet.StatSNMPICMPMSG, *inet.StatSNMPTCP, *inet.StatSNMPUDP, *inet.StatSNMPUDPLite:
327327
if s.netSNMPFile == nil {
328-
return fmt.Errorf("/proc/net/snmp is not opened for hostinet")
328+
return nil
329329
}
330330
rawLine = getLine(s.netSNMPFile, arg, true)
331331
default:

0 commit comments

Comments
 (0)