summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2021-09-01 19:41:43 -0700
committergVisor bot <gvisor-bot@google.com>2021-09-01 19:44:22 -0700
commitdfb3273f887a80c25a6d133fd5a082153ba58570 (patch)
tree3992649b8e1a81f21da5e22c52aec581e1244718 /pkg/sentry
parent2d3919532a7531083a5e4db956401ff0e1356a77 (diff)
Support sending with packet sockets
...through the loopback interface, only. This change only supports sending on packet sockets through the loopback interface as the loopback interface is the only interface used in packet socket syscall tests - the other link endpoints are not excercised with the existing test infrastructure. Support for sending on packet sockets through the other interfaces will be added as needed. BUG: https://fxbug.dev/81592 PiperOrigin-RevId: 394368899
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/socket/socket.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/sentry/socket/socket.go b/pkg/sentry/socket/socket.go
index 658e90bb9..83b9d9389 100644
--- a/pkg/sentry/socket/socket.go
+++ b/pkg/sentry/socket/socket.go
@@ -750,6 +750,7 @@ func AddressAndFamily(addr []byte) (tcpip.FullAddress, uint16, *syserr.Error) {
return tcpip.FullAddress{
NIC: tcpip.NICID(a.InterfaceIndex),
Addr: tcpip.Address(a.HardwareAddr[:header.EthernetAddressSize]),
+ Port: Ntohs(a.Protocol),
}, family, nil
case linux.AF_UNSPEC: