summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/testutil/kernel.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-02-20 15:19:40 -0800
committerCopybara-Service <copybara-worker@google.com>2020-02-20 15:20:40 -0800
commit4a73bae269ae9f52a962ae3b08a17ccaacf7ba80 (patch)
treef79489b8eabed3412e80697387908c694fcee592 /pkg/sentry/fsimpl/testutil/kernel.go
parent67b615b86f2aa1d4ded3dcf2eb8aca4e7fec57a0 (diff)
Initial network namespace support.
TCP/IP will work with netstack networking. hostinet doesn't work, and sockets will have the same behavior as it is now. Before the userspace is able to create device, the default loopback device can be used to test. /proc/net and /sys/net will still be connected to the root network stack; this is the same behavior now. Issue #1833 PiperOrigin-RevId: 296309389
Diffstat (limited to 'pkg/sentry/fsimpl/testutil/kernel.go')
-rw-r--r--pkg/sentry/fsimpl/testutil/kernel.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/testutil/kernel.go b/pkg/sentry/fsimpl/testutil/kernel.go
index d0be32e72..488478e29 100644
--- a/pkg/sentry/fsimpl/testutil/kernel.go
+++ b/pkg/sentry/fsimpl/testutil/kernel.go
@@ -128,6 +128,7 @@ func CreateTask(ctx context.Context, name string, tc *kernel.ThreadGroup, mntns
ThreadGroup: tc,
TaskContext: &kernel.TaskContext{Name: name},
Credentials: auth.CredentialsFromContext(ctx),
+ NetworkNamespace: k.RootNetworkNamespace(),
AllowedCPUMask: sched.NewFullCPUSet(k.ApplicationCores()),
UTSNamespace: kernel.UTSNamespaceFromContext(ctx),
IPCNamespace: kernel.IPCNamespaceFromContext(ctx),