git: 7c22dda66913 - main - nd6: Add router address and DHCPv6-PD flags in PIO headers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Jul 2026 13:39:11 UTC
The branch main has been updated by pouria:
URL: https://cgit.FreeBSD.org/src/commit/?id=7c22dda66913347fba2e488440cf00e7f8a26470
commit 7c22dda66913347fba2e488440cf00e7f8a26470
Author: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
AuthorDate: 2026-07-16 13:24:22 +0000
Commit: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
CommitDate: 2026-07-16 13:26:59 +0000
nd6: Add router address and DHCPv6-PD flags in PIO headers
Make R-bit per RFC 6275 8.3 and P-bit per RFC 9762 7.1 in
Prefix Information option available to userland for future implementations.
RFC 9762 7.1: For each interface, the client MUST keep a list of every prefix
that was received from a PIO with the P flag set and currently has a non-zero
preferred lifetime.
Differential Revision: https://reviews.freebsd.org/D56207
---
sys/netinet/icmp6.h | 6 ++++--
sys/netinet6/in6_var.h | 6 +++++-
sys/netinet6/nd6.h | 1 +
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h
index 77145e4c7503..12fbf7cc3f5c 100644
--- a/sys/netinet/icmp6.h
+++ b/sys/netinet/icmp6.h
@@ -319,8 +319,10 @@ struct nd_opt_prefix_info { /* prefix information */
struct in6_addr nd_opt_pi_prefix;
} __packed;
-#define ND_OPT_PI_FLAG_ONLINK 0x80
-#define ND_OPT_PI_FLAG_AUTO 0x40
+#define ND_OPT_PI_FLAG_ONLINK 0x80 /* RFC 4861 */
+#define ND_OPT_PI_FLAG_AUTO 0x40 /* RFC 4861 */
+#define ND_OPT_PI_FLAG_ROUTER 0x20 /* RFC 6275 */
+#define ND_OPT_PI_FLAG_DHCP6PD 0x10 /* RFC 9762 */
struct nd_opt_rd_hdr { /* redirected header */
u_int8_t nd_opt_rh_type;
diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h
index b1209a324cc9..655787c9ba53 100644
--- a/sys/netinet6/in6_var.h
+++ b/sys/netinet6/in6_var.h
@@ -306,7 +306,9 @@ struct in6_prflags {
struct prf_ra {
u_char onlink : 1;
u_char autonomous : 1;
- u_char reserved : 6;
+ u_char router : 1;
+ u_char dhcp6_pd : 1;
+ u_char reserved : 4;
} prf_ra;
u_char prf_reserved1;
u_short prf_reserved2;
@@ -337,6 +339,8 @@ struct in6_prefixreq {
#define ipr_raf_onlink ipr_flags.prf_ra.onlink
#define ipr_raf_auto ipr_flags.prf_ra.autonomous
+#define ipr_raf_router ipr_flags.prf_ra.router
+#define ipr_raf_dhcp6pd ipr_flags.prf_ra.dhcp6_pd
#define ipr_statef_onlink ipr_flags.prf_state.onlink
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index 372d06b6574d..8c9eaed18627 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -230,6 +230,7 @@ struct nd_prefix {
#define ndpr_raf_onlink ndpr_flags.onlink
#define ndpr_raf_auto ndpr_flags.autonomous
#define ndpr_raf_router ndpr_flags.router
+#define ndpr_raf_dhcp6pd ndpr_flags.dhcp6_pd
struct nd_pfxrouter {
LIST_ENTRY(nd_pfxrouter) pfr_entry;