networkd-dhcp6: Do not handle prefix expiry
Expiring prefixes need not be handled anymore as the kernel has been instructed not to create routes for DHCPv6 assigned addresses via the IFA_F_NOPREFIXROUTE flag.
This commit is contained in:
parent
851c9f8273
commit
47d45d3cde
|
@ -86,42 +86,6 @@ static int dhcp6_address_update(Link *link, struct in6_addr *ip6_addr,
|
|||
return r;
|
||||
}
|
||||
|
||||
static 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_icmp6_ra_get_expired_prefix(link->icmp6_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;
|
||||
|
||||
sd_dhcp6_lease_reset_address_iter(lease);
|
||||
|
||||
while (sd_dhcp6_lease_get_address(lease, &ip6_addr,
|
||||
&lifetime_preferred,
|
||||
&lifetime_valid) >= 0) {
|
||||
|
||||
r = sd_icmp6_prefix_match(expired_prefix, expired_prefixlen,
|
||||
&ip6_addr);
|
||||
if (r >= 0) {
|
||||
r = dhcp6_address_update(link, &ip6_addr, 128,
|
||||
lifetime_preferred,
|
||||
lifetime_valid);
|
||||
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dhcp6_lease_address_acquired(sd_dhcp6_client *client, Link *link) {
|
||||
int r;
|
||||
sd_dhcp6_lease *lease;
|
||||
|
@ -310,6 +274,7 @@ static void icmp6_router_handler(sd_icmp6_nd *nd, int event, void *userdata) {
|
|||
|
||||
switch(event) {
|
||||
case ICMP6_EVENT_ROUTER_ADVERTISMENT_NONE:
|
||||
case ICMP6_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED:
|
||||
return;
|
||||
|
||||
case ICMP6_EVENT_ROUTER_ADVERTISMENT_TIMEOUT:
|
||||
|
@ -319,11 +284,6 @@ static void icmp6_router_handler(sd_icmp6_nd *nd, int event, void *userdata) {
|
|||
|
||||
break;
|
||||
|
||||
case ICMP6_EVENT_ROUTER_ADVERTISMENT_PREFIX_EXPIRED:
|
||||
dhcp6_prefix_expired(link);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
if (event < 0)
|
||||
log_link_warning(link, "ICMPv6 error: %s",
|
||||
|
|
Loading…
Reference in New Issue