]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: Introduce UseDNR DHCPv6 option
authorRonan Pigott <ronan@rjp.ie>
Thu, 18 Jan 2024 01:16:47 +0000 (18:16 -0700)
committerRonan Pigott <ronan@rjp.ie>
Mon, 21 Oct 2024 16:10:19 +0000 (09:10 -0700)
This is equivalent to the DHCPv4 option introduced earlier.

src/libsystemd-network/dhcp6-option.c
src/network/networkd-dhcp-common.h
src/network/networkd-dhcp6.c
src/network/networkd-dns.c
src/network/networkd-network-gperf.gperf
src/network/networkd-network.c
src/network/networkd-network.h

index 787cc37d001bd7cfb38fcc6cb9bdce9708db9823..507cd3547d4aa04f0ddc6df3f0c2d268a1609768 100644 (file)
@@ -206,6 +206,7 @@ bool dhcp6_option_can_request(uint16_t option) {
         case SD_DHCP6_OPTION_V6_DOTS_RI:
         case SD_DHCP6_OPTION_V6_DOTS_ADDRESS:
         case SD_DHCP6_OPTION_IPV6_ADDRESS_ANDSF:
+        case SD_DHCP6_OPTION_V6_DNR:
                 return true;
         default:
                 return false;
index 194930a87c634227f21b6f620e1dccd1f70d902e..778378f5ff742fc0543e1fa832379eb098cb0163 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "conf-parser.h"
 #include "dhcp-duid-internal.h"
+#include "dns-resolver-internal.h"
 #include "in-addr-util.h"
 #include "set.h"
 #include "time-util.h"
index 3f773cbb9933d07a1b1cafd34367de7622ee2b32..fdab0e0e23a129258dd62f2ca677032768ce1a84 100644 (file)
@@ -646,6 +646,12 @@ static int dhcp6_configure(Link *link) {
                         return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to request domains: %m");
         }
 
+        if (link_get_use_dnr(link, NETWORK_CONFIG_SOURCE_DHCP6)) {
+                r = sd_dhcp6_client_set_request_option(client, SD_DHCP6_OPTION_V6_DNR);
+                if (r < 0)
+                        return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to request DNR: %m");
+        }
+
         if (link->network->dhcp6_use_captive_portal > 0) {
                 r = sd_dhcp6_client_set_request_option(client, SD_DHCP6_OPTION_CAPTIVE_PORTAL);
                 if (r < 0)
index fb2b282bc85695e3254b03ed9af1f69554097c80..b57785a92a0f697276a609714b8cc9c148488020 100644 (file)
@@ -106,6 +106,9 @@ bool link_get_use_dnr(Link *link, NetworkConfigSource proto) {
         case NETWORK_CONFIG_SOURCE_DHCP4:
                 n = link->network->dhcp_use_dnr;
                 break;
+        case NETWORK_CONFIG_SOURCE_DHCP6:
+                n = link->network->dhcp6_use_dnr;
+                break;
         default:
                 assert_not_reached();
         }
index 89be7e8ae23b1539661762b9b678462ad88876fb..61dd333e1d75b7b0c82ad348a4beaee2bf4ffbb1 100644 (file)
@@ -279,6 +279,7 @@ DHCPv4.RapidCommit,                          config_parse_tristate,
 DHCPv6.UseAddress,                           config_parse_bool,                                        0,                             offsetof(Network, dhcp6_use_address)
 DHCPv6.UseDelegatedPrefix,                   config_parse_bool,                                        0,                             offsetof(Network, dhcp6_use_pd_prefix)
 DHCPv6.UseDNS,                               config_parse_tristate,                                    0,                             offsetof(Network, dhcp6_use_dns)
+DHCPv6.UseDNR,                               config_parse_tristate,                                    0,                             offsetof(Network, dhcp6_use_dnr)
 DHCPv6.UseHostname,                          config_parse_bool,                                        0,                             offsetof(Network, dhcp6_use_hostname)
 DHCPv6.UseDomains,                           config_parse_use_domains,                                 0,                             offsetof(Network, dhcp6_use_domains)
 DHCPv6.UseNTP,                               config_parse_tristate,                                    0,                             offsetof(Network, dhcp6_use_ntp)
index 873894d82ccdfa3c0fc6c516c87aff5702b1b73a..6339e25cef1477fd1dfe2723b94d6518063764e9 100644 (file)
@@ -408,6 +408,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
                 .dhcp6_use_address = true,
                 .dhcp6_use_pd_prefix = true,
                 .dhcp6_use_dns = -1,
+                .dhcp6_use_dnr = -1,
                 .dhcp6_use_domains = _USE_DOMAINS_INVALID,
                 .dhcp6_use_hostname = true,
                 .dhcp6_use_ntp = -1,
index fbcc5be9c5d103e62842ed7d0e21fb56ccc348e2..74fefde07a1a6738efc2993f66172b7c0cdee476 100644 (file)
@@ -186,6 +186,7 @@ struct Network {
         bool dhcp6_send_hostname;
         bool dhcp6_send_hostname_set;
         int dhcp6_use_dns;
+        int dhcp6_use_dnr;
         bool dhcp6_use_hostname;
         int dhcp6_use_ntp;
         bool dhcp6_use_captive_portal;