1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 00:32:04 +02:00

net: dhcp6: Add DHCPv6 (DHCP for IPv6)

Adds DHCPv6 protocol to u-boot.

Allows for address assignement with DHCPv6 4-message exchange
(SOLICIT->ADVERTISE->REQUEST->REPLY).  Includes DHCPv6 options
required by RFC 8415.  Also adds DHCPv6 options required
for PXE boot.

Possible enhancements:
- Duplicate address detection on DHCPv6 assigned address
- IPv6 address assignement through SLAAC
- Sending/parsing other DHCPv6 options (NTP, DNS, etc...)

Signed-off-by: Sean Edmond <seanedmond@microsoft.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
This commit is contained in:
Sean Edmond
2023-04-11 10:48:46 -07:00
committed by Tom Rini
parent 0b99afec9c
commit a0245818f7
5 changed files with 989 additions and 4 deletions

View File

@@ -107,6 +107,8 @@
#include <watchdog.h>
#include <linux/compiler.h>
#include <test/test.h>
#include <net/tcp.h>
#include <net/wget.h>
#include "arp.h"
#include "bootp.h"
#include "cdp.h"
@@ -120,8 +122,7 @@
#if defined(CONFIG_CMD_WOL)
#include "wol.h"
#endif
#include <net/tcp.h>
#include <net/wget.h>
#include "dhcpv6.h"
/** BOOTP EXTENTIONS **/
@@ -135,6 +136,8 @@ struct in_addr net_dns_server;
/* Our 2nd DNS IP address */
struct in_addr net_dns_server2;
#endif
/* Indicates whether the pxe path prefix / config file was specified in dhcp option */
char *pxelinux_configfile;
/** END OF BOOTP EXTENTIONS **/
@@ -510,6 +513,10 @@ restart:
dhcp_request(); /* Basically same as BOOTP */
break;
#endif
case DHCP6:
if (IS_ENABLED(CONFIG_CMD_DHCP6))
dhcp6_start();
break;
#if defined(CONFIG_CMD_BOOTP)
case BOOTP:
bootp_reset();