[systemd-devel] [PATCH 3/3] networkd-dhcp6: Do not handle prefix expiry
Tom Gundersen
teg at jklm.no
Fri Mar 27 04:05:26 PDT 2015
On Wed, Mar 25, 2015 at 2:37 PM, Patrik Flykt
<patrik.flykt at linux.intel.com> wrote:
> 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.
Great stuff. Please push all three!
-t
> ---
> src/network/networkd-dhcp6.c | 42 +-----------------------------------------
> 1 file changed, 1 insertion(+), 41 deletions(-)
>
> diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
> index 283a7d6..e863f4b 100644
> --- a/src/network/networkd-dhcp6.c
> +++ b/src/network/networkd-dhcp6.c
> @@ -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",
> --
> 2.1.4
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
More information about the systemd-devel
mailing list