From a0245818f7f8e375abc00f36ff88326331e4e2f9 Mon Sep 17 00:00:00 2001 From: Sean Edmond Date: Tue, 11 Apr 2023 10:48:46 -0700 Subject: 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 Reviewed-by: Ramon Fried --- net/net.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'net/net.c') diff --git a/net/net.c b/net/net.c index c9a749f6cc..8cb8b4b9f3 100644 --- a/net/net.c +++ b/net/net.c @@ -107,6 +107,8 @@ #include #include #include +#include +#include #include "arp.h" #include "bootp.h" #include "cdp.h" @@ -120,8 +122,7 @@ #if defined(CONFIG_CMD_WOL) #include "wol.h" #endif -#include -#include +#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(); -- cgit v1.2.3