commit | 95066fc340ac139848af3bcc1a44ee7366bfbadf | [log] [tgz] |
---|---|---|
author | David Crawshaw <crawshaw@google.com> | Fri May 19 14:52:13 2017 -0400 |
committer | David Crawshaw <crawshaw@google.com> | Fri May 19 15:47:01 2017 -0400 |
tree | cd820dadf75138e2f98f4d8fa709a436db5844b8 | |
parent | 4e49ba9a9603d457e8556063a8a6dda475d37288 [diff] |
dns: close endpoint when no longer needed Keeping the old endpoint open on a UDP connection meant that a future endpoint would not pick up new configuration from a DHCP change. This meant an existing getaddrinfo would wait for its timeout if a DHCP IP address appeared in the middle of its attempts. Closing the endpoint after each attempt means the next one will try the new, better path and actually succeed. In practice, this means if `wget http://www.google.com` is stuck on getaddrinfo before a DHCP IP has been picked up, it will now wait the 3 second timeout and on the next attempt succeed, instead of blocking for a long time. NET-77 # done Change-Id: Ie945685b12d24862ba6ac562830ca9a72d39d513
Netstack is a network stack written in Go.
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>
We would love to accept contributions, but we have not yet worked out how to handle them. Please contact us before sending any pull requests.
Whatever we do decide on will require signing the Google Contributor License. Please see CONTRIBUTING.md for more details.
This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.