diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-18 17:06:31 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-22 17:19:54 +0200 |
commit | 9b4d33193af554628c369681404b0c3809a7d6db (patch) | |
tree | 1f340c13ee4317dedb3acb91021ee3b60e1b92ea /src | |
parent | 6d8f6b0b2ae14aee0b02c7e3d1edaeaa2c118056 (diff) |
networkd: dhcp6 - do not handle prefix expiration
This ressurects 47d45d3cde45d6545367570264e4e3636bc9e345. We now always use /128 prefixes,
so there is no need for the DHCPv6 code to know about prefixes expiring.
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-dhcp6.c | 40 | ||||
-rw-r--r-- | src/network/networkd-link.h | 1 | ||||
-rw-r--r-- | src/network/networkd-ndisc.c | 7 |
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"); |