diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-01-21 20:21:36 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-21 20:21:36 +0000 |
commit | 4d096cb938f0e2911f69c0915b4339405e3469ad (patch) | |
tree | 78a854c6509d4b5816d43903aa1753fc9a3cfefc /pkg/sentry/socket/netstack | |
parent | 670296fd3706e318b7bc97912c8eda54712b3973 (diff) | |
parent | 5f82f092e7c5df8be8f9f8bacfbc135792ff2f5e (diff) |
Merge release-20200115.0-48-g5f82f09 (automated)
Diffstat (limited to 'pkg/sentry/socket/netstack')
-rwxr-xr-x | pkg/sentry/socket/netstack/netstack.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/sentry/socket/netstack/netstack.go b/pkg/sentry/socket/netstack/netstack.go index fec575357..2662fbc0f 100755 --- a/pkg/sentry/socket/netstack/netstack.go +++ b/pkg/sentry/socket/netstack/netstack.go @@ -868,7 +868,11 @@ func (s *SocketOperations) GetSockOpt(t *kernel.Task, level, name int, outPtr us return nil, syserr.ErrInvalidArgument } - info, err := netfilter.GetInfo(t, s.Endpoint, outPtr) + stack := inet.StackFromContext(t) + if stack == nil { + return nil, syserr.ErrNoDevice + } + info, err := netfilter.GetInfo(t, stack.(*Stack).Stack, outPtr) if err != nil { return nil, err } @@ -879,7 +883,11 @@ func (s *SocketOperations) GetSockOpt(t *kernel.Task, level, name int, outPtr us return nil, syserr.ErrInvalidArgument } - entries, err := netfilter.GetEntries(t, s.Endpoint, outPtr, outLen) + stack := inet.StackFromContext(t) + if stack == nil { + return nil, syserr.ErrNoDevice + } + entries, err := netfilter.GetEntries(t, stack.(*Stack).Stack, outPtr, outLen) if err != nil { return nil, err } |