dhcp: small client fixes and more debugging

Accept hops values from servers not equal to zero. (The spec allows
this, and I found a corp DHCP server that sends these.)

Clear siaddr and giaddr when sending DHCPREQUEST. Servers are good
about ignoring these values, but technically they should be zero.

Lots of string printing for DHCP headers, which is useful in debugging.
I will probably export the header type in some future CL for use
in the netdbg tool.

Change-Id: I8cb3f9b92d9ddd9d2fb2ce8eb25348195396cffe
3 files changed
tree: 3009ac24eebfa656d3ec539c12912d26c5999ff2
  1. dhcp/
  2. dns/
  3. ilist/
  4. tcpip/
  5. tmutex/
  6. waiter/
  7. AUTHORS
  8. CONTRIBUTING.md
  9. CONTRIBUTORS
  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

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.

Disclaimer

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