summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/dev/dev.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-02-28 18:41:19 +0000
committergVisor bot <gvisor-bot@google.com>2020-02-28 18:41:19 +0000
commit1b6b97edeb8275bbe86594c9eec8fa753dd37cd3 (patch)
tree71dbb76ee0121c6fd450a271d89790fb8d2232cc /pkg/sentry/fs/dev/dev.go
parent06b05079451454a2a72009b581717674929ade28 (diff)
parent6b4d36e3253238dd72d0861ac1220d147e1de8dd (diff)
Merge release-20200219.0-65-g6b4d36e (automated)
Diffstat (limited to 'pkg/sentry/fs/dev/dev.go')
-rw-r--r--pkg/sentry/fs/dev/dev.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/sentry/fs/dev/dev.go b/pkg/sentry/fs/dev/dev.go
index 7e66c29b0..acbd401a0 100644
--- a/pkg/sentry/fs/dev/dev.go
+++ b/pkg/sentry/fs/dev/dev.go
@@ -22,6 +22,7 @@ import (
"gvisor.dev/gvisor/pkg/sentry/fs"
"gvisor.dev/gvisor/pkg/sentry/fs/ramfs"
"gvisor.dev/gvisor/pkg/sentry/fs/tmpfs"
+ "gvisor.dev/gvisor/pkg/sentry/inet"
"gvisor.dev/gvisor/pkg/usermem"
)
@@ -124,10 +125,12 @@ func New(ctx context.Context, msrc *fs.MountSource) *fs.Inode {
"ptmx": newSymlink(ctx, "pts/ptmx", msrc),
"tty": newCharacterDevice(ctx, newTTYDevice(ctx, fs.RootOwner, 0666), msrc, ttyDevMajor, ttyDevMinor),
+ }
- "net": newDirectory(ctx, map[string]*fs.Inode{
+ if isNetTunSupported(inet.StackFromContext(ctx)) {
+ contents["net"] = newDirectory(ctx, map[string]*fs.Inode{
"tun": newCharacterDevice(ctx, newNetTunDevice(ctx, fs.RootOwner, 0666), msrc, netTunDevMajor, netTunDevMinor),
- }, msrc),
+ }, msrc)
}
iops := ramfs.NewDir(ctx, contents, fs.RootOwner, fs.FilePermsFromMode(0555))