commit | edfbb1b67d8c386803a844e132bdd6cbe385eef6 | [log] [tgz] |
---|---|---|
author | Sergey Ulanov <sergeyu@chromium.org> | Thu Jul 12 18:29:44 2018 -0700 |
committer | Sergey Ulanov <sergeyu@chromium.org> | Mon Jul 16 10:16:05 2018 -0700 |
tree | bcccffbe550ad0b02040d8fbb4dd78324d84c0eb | |
parent | 119be4161d370f95f45cd3908d79bb81b5ae13f9 [diff] |
[netstack] Fix setsockopt() to handle ip_mreq.imr_address=INADDR_ANY Previosly setsockopt(IP_ADD_MEMBERSHIP) worked only when imr_address is set to an interface address, but it should allow INADDR_ANY when an interface id is specified. Also fixed IP_DROP_MEMBERSHIP. Change-Id: Ic9ff0b6a13f5d25e311b699ae86b7708b2f45042
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.