gvisor/pkg/tcpip/header
Ghanan Gowripalan 5398530e45 Discover on-link prefixes from Router Advertisements' Prefix Information options
This change allows the netstack to do NDP's Prefix Discovery as outlined by
RFC 4861 section 6.3.4. If configured to do so, when a new on-link prefix is
discovered, the routing table will be updated with a device route through
the nic the RA arrived at. Likewise, when such a prefix gets invalidated, the
device route will be removed.

Note, this change will not break existing uses of netstack as the default
configuration for the stack options is set in such a way that Prefix Discovery
will not be performed. See `stack.Options` and `stack.NDPConfigurations` for
more details.

This change reuses 1 option and introduces a new one that is required to take
advantage of Prefix Discovery, all available under NDPConfigurations:
- HandleRAs: Whether or not NDP RAs are processes
- DiscoverOnLinkPrefixes: Whether or not Prefix Discovery is performed (new)

Another note: for a NIC to process Prefix Information options (in Router
Advertisements), it must not be a router itself. Currently the netstack does not
have per-interface routing configuration; the routing/forwarding configuration
is controlled stack-wide. Therefore, if the stack is configured to enable
forwarding/routing, no router Advertisements (and by extension the Prefix
Information options) will be processed.

Tests: Unittest to make sure that Prefix Discovery and updates to the routing
table only occur if explicitly configured to do so. Unittest to make sure at
max stack.MaxDiscoveredOnLinkPrefixes discovered on-link prefixes are
remembered.
PiperOrigin-RevId: 280049278
2019-11-12 14:09:43 -08:00
..
BUILD Add a type to represent the NDP Router Advertisement message. 2019-10-22 14:41:51 -07:00
arp.go Update canonical repository. 2019-06-13 16:50:15 -07:00
checksum.go netstack/tcp: software segmentation offload 2019-10-22 11:55:56 -07:00
checksum_test.go netstack/tcp: software segmentation offload 2019-10-22 11:55:56 -07:00
eth.go Auto-generate an IPv6 link-local address based on the NIC's MAC Address. 2019-10-22 07:26:54 -07:00
eth_test.go Auto-generate an IPv6 link-local address based on the NIC's MAC Address. 2019-10-22 07:26:54 -07:00
gue.go Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
icmpv4.go Make UDP traceroute work. 2019-09-03 16:01:17 -07:00
icmpv6.go Validate the checksum for incoming ICMPv6 packets 2019-10-25 16:06:55 -07:00
interfaces.go Update canonical repository. 2019-06-13 16:50:15 -07:00
ipv4.go Fix bugs in fragment handling. 2019-10-10 15:14:55 -07:00
ipv6.go Discover default routers from Router Advertisements 2019-11-06 16:29:58 -08:00
ipv6_fragment.go Update canonical repository. 2019-06-13 16:50:15 -07:00
ipversion_test.go Update canonical repository. 2019-06-13 16:50:15 -07:00
ndp_neighbor_advert.go Add a type to represent the NDP Router Advertisement message. 2019-10-22 14:41:51 -07:00
ndp_neighbor_solicit.go Add a type to represent the NDP Router Advertisement message. 2019-10-22 14:41:51 -07:00
ndp_options.go Discover on-link prefixes from Router Advertisements' Prefix Information options 2019-11-12 14:09:43 -08:00
ndp_router_advert.go Add a type to represent the NDP Router Advertisement message. 2019-10-22 14:41:51 -07:00
ndp_test.go Support iterating an NDP options buffer. 2019-10-29 10:30:21 -07:00
tcp.go Stub out support for TCP_MAXSEG. 2019-07-12 13:35:17 -07:00
tcp_test.go Update canonical repository. 2019-06-13 16:50:15 -07:00
udp.go Implement splice methods for pipes and sockets. 2019-09-12 17:43:27 -07:00