Fix proc net bugs in VFS2.

The /proc/net/udp header was missing, and /proc/sys/net was set up as
/proc/sys/net/net. Discovered while trying to run networking tests for VFS2.

PiperOrigin-RevId: 309243758
This commit is contained in:
Dean Deng 2020-04-30 09:46:36 -07:00 committed by gVisor bot
parent 4875cda8d1
commit 442fde405d
2 changed files with 3 additions and 3 deletions

View File

@ -511,6 +511,8 @@ func (d *netUDPData) Generate(ctx context.Context, buf *bytes.Buffer) error {
// degrade gracefully and retrieve what we can. // degrade gracefully and retrieve what we can.
t := kernel.TaskFromContext(ctx) t := kernel.TaskFromContext(ctx)
buf.WriteString(" sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode ref pointer drops \n")
for _, se := range d.kernel.ListSockets() { for _, se := range d.kernel.ListSockets() {
s := se.SockVFS2 s := se.SockVFS2
if !s.TryIncRef() { if !s.TryIncRef() {

View File

@ -112,9 +112,7 @@ func newSysNetDir(root *auth.Credentials, inoGen InoGenerator, k *kernel.Kernel)
} }
} }
return kernfs.NewStaticDir(root, inoGen.NextIno(), 0555, map[string]*kernfs.Dentry{ return kernfs.NewStaticDir(root, inoGen.NextIno(), 0555, contents)
"net": kernfs.NewStaticDir(root, inoGen.NextIno(), 0555, contents),
})
} }
// mmapMinAddrData implements vfs.DynamicBytesSource for // mmapMinAddrData implements vfs.DynamicBytesSource for