summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network/networkd-dhcp6.c40
-rw-r--r--src/network/networkd-link.h1
-rw-r--r--src/network/networkd-ndisc.c7
3 files changed, 1 insertions, 47 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
index f47ac15dcd..57c81cb646 100644
--- a/src/network/networkd-dhcp6.c
+++ b/src/network/networkd-dhcp6.c
@@ -25,7 +25,6 @@
#include "networkd-link.h"
#include "network-internal.h"
-#include "sd-ndisc.h"
#include "sd-dhcp6-client.h"
static int dhcp6_lease_address_acquired(sd_dhcp6_client *client, Link *link);
@@ -247,42 +246,3 @@ int dhcp6_configure(Link *link, bool inf_req) {
link->dhcp6_client = sd_dhcp6_client_unref(link->dhcp6_client);
return r;
}
-
-int dhcp6_prefix_expired(Link *link) {
- int r;
- sd_dhcp6_lease *lease;
- struct in6_addr *expired_prefix, ip6_addr;
- uint8_t expired_prefixlen;
- uint32_t lifetime_preferred, lifetime_valid;
-
- r = sd_ndisc_get_expired_prefix(link->ndisc_router_discovery,
- &expired_prefix, &expired_prefixlen);
- if (r < 0)
- return r;
-
- r = sd_dhcp6_client_get_lease(link->dhcp6_client, &lease);
- if (r < 0)
- return r;
-
- log_link_info(link, "IPv6 prefix "SD_NDISC_ADDRESS_FORMAT_STR"/%d expired",
- SD_NDISC_ADDRESS_FORMAT_VAL(*expired_prefix),
- expired_prefixlen);
-
- sd_dhcp6_lease_reset_address_iter(lease);
-
- while (sd_dhcp6_lease_get_address(lease, &ip6_addr,
- &lifetime_preferred,
- &lifetime_valid) >= 0) {
-
- r = sd_ndisc_prefix_match(expired_prefix, expired_prefixlen,
- &ip6_addr);
- if (r < 0)
- continue;
-
- log_link_info(link, "IPv6 prefix length updated "SD_NDISC_ADDRESS_FORMAT_STR"/%d", SD_NDISC_ADDRESS_FORMAT_VAL(ip6_addr), 128);
-
- dhcp6_address_change(link, &ip6_addr, lifetime_preferred, lifetime_valid);
- }
-
- return 0;
-}
diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h
index 6bc88157cf..5c92df4ca8 100644
--- a/src/network/networkd-link.h
+++ b/src/network/networkd-link.h
@@ -146,7 +146,6 @@ int link_set_timezone(Link *link, const char *timezone);
int ipv4ll_configure(Link *link);
int dhcp4_configure(Link *link);
int dhcp6_configure(Link *link, bool information_request);
-int dhcp6_prefix_expired(Link *link);
int ndisc_configure(Link *link);
bool link_lldp_enabled(Link *link);
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index 1721cb36b6..ab4bb51280 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -38,6 +38,7 @@ static void ndisc_router_handler(sd_ndisc *nd, int event, void *userdata) {
switch(event) {
case SD_NDISC_EVENT_ROUTER_ADVERTISMENT_NONE:
+ case SD_NDISC_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED:
return;
case SD_NDISC_EVENT_ROUTER_ADVERTISMENT_OTHER:
@@ -50,12 +51,6 @@ static void ndisc_router_handler(sd_ndisc *nd, int event, void *userdata) {
break;
- case SD_NDISC_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED:
- if (!link->rtnl_extended_attrs)
- dhcp6_prefix_expired(link);
-
- break;
-
default:
if (event < 0)
log_link_warning_errno(link, event, "IPv6 Neighbor Discover error: %m");