summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket/netstack/provider.go
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2020-12-02 11:31:38 -0800
committergVisor bot <gvisor-bot@google.com>2020-12-02 11:34:42 -0800
commit1375a87a209ef1a2523ada84254e3a0101afb4f5 (patch)
treee952593feda9e3f738fbf9bba79bfffdccb72de2 /pkg/sentry/socket/netstack/provider.go
parentdbd4a6e3e581cc081f686096226873f3a39c0369 (diff)
[netstack] Refactor common utils out of netstack to socket package.
Moved AddressAndFamily() and ConvertAddress() to socket package from netstack. This helps because these utilities are used by sibling netstack packages. Such sibling dependencies can later cause circular dependencies. Common utils shared between siblings should be moved up to the parent. PiperOrigin-RevId: 345275571
Diffstat (limited to 'pkg/sentry/socket/netstack/provider.go')
-rw-r--r--pkg/sentry/socket/netstack/provider.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/socket/netstack/provider.go b/pkg/sentry/socket/netstack/provider.go
index ead3b2b79..c847ff1c7 100644
--- a/pkg/sentry/socket/netstack/provider.go
+++ b/pkg/sentry/socket/netstack/provider.go
@@ -158,7 +158,7 @@ func packetSocket(t *kernel.Task, epStack *Stack, stype linux.SockType, protocol
// protocol is passed in network byte order, but netstack wants it in
// host order.
- netProto := tcpip.NetworkProtocolNumber(ntohs(uint16(protocol)))
+ netProto := tcpip.NetworkProtocolNumber(socket.Ntohs(uint16(protocol)))
wq := &waiter.Queue{}
ep, err := epStack.Stack.NewPacketEndpoint(cooked, netProto, wq)