aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorSean Edmond <seanedmond@microsoft.com>2023-04-11 10:48:46 -0700
committerTom Rini <trini@konsulko.com>2023-05-05 17:48:44 -0400
commita0245818f7f8e375abc00f36ff88326331e4e2f9 (patch)
tree12e0d73a675caf185f22e3b92305c2931bdcdd94 /net/net.c
parent0b99afec9c8bb49fd2c28b35f36546b135b52b13 (diff)
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>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c11
1 files changed, 9 insertions, 2 deletions
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 <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();