diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-09-29 22:05:30 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-29 22:05:30 +0000 |
commit | 503847eeb85b1172ec55679aec241d4fa235f08f (patch) | |
tree | 4277736052f3bd81d546c0adfe8063bef4f94352 /pkg/sentry/socket/netstack | |
parent | c4a484f2d0e800ed9949d91fb32a69542103d409 (diff) | |
parent | 7fbb45e8ed82c118338c38fb71e7ff50addaa653 (diff) |
Merge release-20200921.0-70-g7fbb45e8e (automated)
Diffstat (limited to 'pkg/sentry/socket/netstack')
-rw-r--r-- | pkg/sentry/socket/netstack/netstack.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/sentry/socket/netstack/netstack.go b/pkg/sentry/socket/netstack/netstack.go index 6fede181a..20f66fbf1 100644 --- a/pkg/sentry/socket/netstack/netstack.go +++ b/pkg/sentry/socket/netstack/netstack.go @@ -1719,6 +1719,26 @@ func getSockOptIP(t *kernel.Task, s socket.SocketOps, ep commonEndpoint, name in } return &entries, nil + case linux.IPT_SO_GET_REVISION_TARGET: + if outLen < linux.SizeOfXTGetRevision { + return nil, syserr.ErrInvalidArgument + } + + // Only valid for raw IPv4 sockets. + if family, skType, _ := s.Type(); family != linux.AF_INET || skType != linux.SOCK_RAW { + return nil, syserr.ErrProtocolNotAvailable + } + + stack := inet.StackFromContext(t) + if stack == nil { + return nil, syserr.ErrNoDevice + } + ret, err := netfilter.TargetRevision(t, outPtr, header.IPv4ProtocolNumber) + if err != nil { + return nil, err + } + return &ret, nil + default: emitUnimplementedEventIP(t, name) } |