netstack: Don't start endpoint goroutines too soon on restore.

Endpoint protocol goroutines were previously started as part of
loading the endpoint. This is potentially too soon, as resources used
by these goroutine may not have been loaded. Protocol goroutines may
perform meaningful work as soon as they're started (ex: incoming
connect) which can cause them to indirectly access resources that
haven't been loaded yet.

This CL defers resuming all protocol goroutines until the end of
restore.

PiperOrigin-RevId: 262409429
7 files changed
tree: 2c498daebc8f934540feb1e1afabd76593782f57
  1. gate/
  2. ilist/
  3. rand/
  4. sleep/
  5. tcpip/
  6. tmutex/
  7. waiter/
  8. AUTHORS
  9. CONTRIBUTING.md
  10. LICENSE
  11. README.md
README.md

Netstack

Netstack is a network stack written in Go.

Getting started

Try it out on Linux by installing the tun_tcp_echo demo:

go install github.com/google/netstack/tcpip/sample/tun_tcp_echo

Create a TUN device with:

[sudo] ip tuntap add user <username> mode tun <device-name>
[sudo] ip link set <device-name> up
[sudo] ip addr add <ipv4-address>/<mask-length> dev <device-name>

Then run with:

tun_tcp_echo <device-name> <ipv4-address> <port>

Contributions

Please see CONTRIBUTING.md for more details.

Issues/Bug Reports

Netstack is primarily developed as part of gVisor and any issues/bugs should be filed against the gVisor repository as this repo is not actively monitored for bug reports.

Disclaimer

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.