summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2019-11-27 16:19:35 -0800
committergVisor bot <gvisor-bot@google.com>2019-11-27 16:21:05 -0800
commit684f757a228f88e5fabe6ebe6ed54f0db20fd63d (patch)
tree478483acf6986b7b393412ed57ab996d7ca48242 /pkg/sentry/syscalls/linux
parent58afb4be695e6804925ba2be5f2d8c245f079cba (diff)
Add support for receiving TOS and TCLASS control messages in hostinet.
This involves allowing getsockopt/setsockopt for the corresponding socket options, as well as allowing hostinet to process control messages received from the actual recvmsg syscall. PiperOrigin-RevId: 282851425
Diffstat (limited to 'pkg/sentry/syscalls/linux')
-rw-r--r--pkg/sentry/syscalls/linux/sys_socket.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_socket.go b/pkg/sentry/syscalls/linux/sys_socket.go
index ab1001f16..13f77565f 100644
--- a/pkg/sentry/syscalls/linux/sys_socket.go
+++ b/pkg/sentry/syscalls/linux/sys_socket.go
@@ -802,6 +802,14 @@ func recvSingleMsg(t *kernel.Task, s socket.Socket, msgPtr usermem.Addr, flags i
controlData = control.PackInq(t, cms.IP.Inq, controlData)
}
+ if cms.IP.HasTOS {
+ controlData = control.PackTOS(t, cms.IP.TOS, controlData)
+ }
+
+ if cms.IP.HasTClass {
+ controlData = control.PackTClass(t, cms.IP.TClass, controlData)
+ }
+
if cms.Unix.Rights != nil {
controlData, mflags = control.PackRights(t, cms.Unix.Rights.(control.SCMRights), flags&linux.MSG_CMSG_CLOEXEC != 0, controlData, mflags)
}