diff options
| author | Ehsan Mohandesi <[email protected]> | 2023-04-21 17:08:21 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-05-05 17:58:52 -0400 |
| commit | 6de98b60ba89fb96a3adada11a5b5406f3b3786b (patch) | |
| tree | 37713f86715e19599874069861547f09037528b0 /cmd | |
| parent | 09005c2fb288decb4010f062fdc87d0b82e57584 (diff) | |
net: ipv6: Add support for default gateway discovery.
In IPv6, the default gateway and prefix length are determined by receiving
a router advertisement as defined in -
https://www.rfc-editor.org/rfc/rfc4861.
Add support for sending router solicitation (RS) and processing router
advertisements (RA).
If the RA has prefix info option and following conditions are met, then
gatewayip6 and net_prefix_length of ip6addr env variables are initialized.
These are later consumed by IPv6 code for non-local destination IP.
- "Router Lifetime" != 0
- Prefix is NOT link-local prefix (0xfe80::/10)
- L flag is 1
- "Valid Lifetime" != 0
Timing Parameters:
- MAX_RTR_SOLICITATION_DELAY (0-1s)
- RTR_SOLICITATION_INTERVAL (4s) (min retransmit delay)
- MAX_RTR_SOLICITATIONS (3 RS transmissions)
The functionality is enabled by CONFIG_IPV6_ROUTER_DISCOVERY and invoked
automatically from net_init_loop().
Signed-off-by: Ehsan Mohandesi <[email protected]>
Tested-by: Viacheslav Mitrofanov <[email protected]>Reviewed-by:
Tested-by: Viacheslav Mitrofanov <[email protected]>
Reviewed-by: Viacheslav Mitrofanov <[email protected]>
Tested-by: Sergei Antonov <[email protected]>
Reviewed-by: Sergei Antonov <[email protected]>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/Kconfig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index 460f29883ae..65957da7f57 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1942,6 +1942,12 @@ config CMD_NCSI Normally this happens automatically before other network operations. +config IPV6_ROUTER_DISCOVERY + bool "Do IPv6 router discovery" + depends on IPV6 + help + Will automatically perform router solicitation on first IPv6 + network operation endif config CMD_ETHSW |
