From abbdcebc543242862fad0984db2db0a842021917 Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Mon, 8 Mar 2021 20:37:14 -0800 Subject: Implement /proc/sys/net/ipv4/ip_local_port_range Speeds up the socket stress tests by a couple orders of magnitude. PiperOrigin-RevId: 361721050 --- pkg/sentry/inet/inet.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg/sentry/inet/inet.go') diff --git a/pkg/sentry/inet/inet.go b/pkg/sentry/inet/inet.go index f31277d30..6b71bd3a9 100644 --- a/pkg/sentry/inet/inet.go +++ b/pkg/sentry/inet/inet.go @@ -93,6 +93,14 @@ type Stack interface { // SetForwarding enables or disables packet forwarding between NICs. SetForwarding(protocol tcpip.NetworkProtocolNumber, enable bool) error + + // PortRange returns the UDP and TCP inclusive range of ephemeral ports + // used in both IPv4 and IPv6. + PortRange() (uint16, uint16) + + // SetPortRange sets the UDP and TCP IPv4 and IPv6 ephemeral port range + // (inclusive). + SetPortRange(start uint16, end uint16) error } // Interface contains information about a network interface. -- cgit v1.2.3