summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2016-05-20 19:00:08 +0200
committerTom Gundersen <teg@jklm.no>2016-05-20 19:00:08 +0200
commite4de3d23bbadfa4004f9c8e431c4011102ea42c1 (patch)
treeaa5c323d9676aea25c27053759596aec6f569a34 /src/network
parente506f43666e80a931e0ed6a66dd6f3bf76fbfaf2 (diff)
parent59bc1530b8a06621bf29109984898daa3f8cc6ce (diff)
Merge pull request #3304 from tomty89/master
[networkd] ndisc DHCPv6 triggering fixes
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-dhcp6.c6
-rw-r--r--src/network/networkd-ndisc.c8
2 files changed, 8 insertions, 6 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
index 6085b28f86..37e13e639e 100644
--- a/src/network/networkd-dhcp6.c
+++ b/src/network/networkd-dhcp6.c
@@ -194,12 +194,6 @@ int dhcp6_request_address(Link *link) {
if (r < 0)
return r;
- if (running) {
- r = sd_dhcp6_client_start(link->dhcp6_client);
- if (r < 0)
- return r;
- }
-
return 0;
}
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index b22c58bfe5..78f02cf746 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -157,6 +157,10 @@ static void ndisc_router_handler(sd_ndisc *nd, uint8_t flags, const struct in6_a
if (flags & ND_RA_FLAG_MANAGED)
dhcp6_request_address(link);
+ r = sd_dhcp6_client_set_local_address(link->dhcp6_client, &link->ipv6ll_address);
+ if (r < 0 && r != -EBUSY)
+ return log_link_warning_errno(link, r, "Could not set IPv6LL address in DHCP client: %m");
+
r = sd_dhcp6_client_start(link->dhcp6_client);
if (r < 0 && r != -EBUSY)
log_link_warning_errno(link, r, "Starting DHCPv6 client on NDisc request failed: %m");
@@ -203,6 +207,10 @@ static void ndisc_handler(sd_ndisc *nd, int event, void *userdata) {
case SD_NDISC_EVENT_TIMEOUT:
dhcp6_request_address(link);
+ r = sd_dhcp6_client_set_local_address(link->dhcp6_client, &link->ipv6ll_address);
+ if (r < 0 && r != -EBUSY)
+ return log_link_warning_errno(link, r, "Could not set IPv6LL address in DHCP client: %m");
+
r = sd_dhcp6_client_start(link->dhcp6_client);
if (r < 0 && r != -EBUSY)
log_link_warning_errno(link, r, "Starting DHCPv6 client after NDisc timeout failed: %m");