summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-dhcp6.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2018-09-07 22:15:55 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2018-09-19 21:45:17 +0200
commit125f20b4de130a31ff9cf0cdcc579b99d7822a04 (patch)
treedcf2cffa743d484cb46c86fc28300fec60d90ee6 /src/network/networkd-dhcp6.c
parentdhcp6-client: Add tests for address, information and prefix requests (diff)
downloadsystemd-125f20b4de130a31ff9cf0cdcc579b99d7822a04.tar.xz
systemd-125f20b4de130a31ff9cf0cdcc579b99d7822a04.zip
networkd-network: Introduce DHCPv6 PD knob for RFC 7084 WPD-4
RFC 7084, WPD-4, requires Customer Edge end routers to behave according to the following: "WPD-4: By default, the IPv6 CE router MUST initiate DHCPv6 prefix delegation when either the M or O flags are set to 1 in a received Router Advertisement (RA) message. Behavior of the CE router to use DHCPv6 prefix delegation when the CE router has not received any RA or received an RA with the M and the O bits set to zero is out of scope for this document." Since it cannot be automatically detected whether DHCPv6 is to be operated as an CE end router or whether to initiate an Informational exchange to obtain other useful network information via DHCPv6 when the Router Advertisement 'O' bit is set, a 'ForceDHCPv6PDOtherInformation' boolean network configuration option in the '[DHCP]' section of a is introduced. Setting this option causes DHCPv6 to be started in stateful mode, although only the 'O' bit is seen in the Router Advertisement. When 'ForceDHCPv6PDOtherInformation' is set and the Router Advertisement has only the Other information 'O' bit set, disable requests for IA_NA addresses. Fixes #9745.
Diffstat (limited to 'src/network/networkd-dhcp6.c')
-rw-r--r--src/network/networkd-dhcp6.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
index 0aa7a190c4..f9b97d17dd 100644
--- a/src/network/networkd-dhcp6.c
+++ b/src/network/networkd-dhcp6.c
@@ -403,11 +403,12 @@ static void dhcp6_handler(sd_dhcp6_client *client, int event, void *userdata) {
}
int dhcp6_request_address(Link *link, int ir) {
- int r, inf_req;
+ int r, inf_req, pd;
bool running;
assert(link);
assert(link->dhcp6_client);
+ assert(link->network);
assert(in_addr_is_link_local(AF_INET6, (const union in_addr_union*)&link->ipv6ll_address) > 0);
r = sd_dhcp6_client_is_running(link->dhcp6_client);
@@ -416,6 +417,21 @@ int dhcp6_request_address(Link *link, int ir) {
else
running = r;
+ r = sd_dhcp6_client_get_prefix_delegation(link->dhcp6_client, &pd);
+ if (r < 0)
+ return r;
+
+ if (pd && ir && link->network->dhcp6_force_pd_other_information) {
+ log_link_debug(link, "Enabling managed mode to request DHCPv6 PD with 'Other Information' set");
+
+ r = sd_dhcp6_client_set_address_request(link->dhcp6_client,
+ false);
+ if (r < 0 )
+ return r;
+
+ ir = false;
+ }
+
if (running) {
r = sd_dhcp6_client_get_information_request(link->dhcp6_client, &inf_req);
if (r < 0)