[systemd-devel] [PATCH 24/24] networkd: Add initial DHCPv6 support

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Jun 18 07:23:02 PDT 2014


On Fri, Jun 13, 2014 at 04:45:14PM +0300, Patrik Flykt wrote:
> Enable DHCPv6 support by creating a DHCPv6 boolean in the Network
> section. Add necessary dhcp6 structures and initial function calls.
> ---
>  src/network/networkd-link.c              | 75 ++++++++++++++++++++++++++++++++
>  src/network/networkd-network-gperf.gperf |  1 +
>  src/network/networkd.h                   |  3 ++
>  3 files changed, 79 insertions(+)
> 
> diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
> index 3653426..507e82d 100644
> --- a/src/network/networkd-link.c
> +++ b/src/network/networkd-link.c
> @@ -120,6 +120,8 @@ static void link_free(Link *link) {
>  
>          sd_ipv4ll_unref(link->ipv4ll);
>  
> +        sd_dhcp6_client_unref(link->dhcp6_client);
> +
>          hashmap_remove(link->manager->links, &link->ifindex);
>  
>          free(link->ifname);
> @@ -231,6 +233,17 @@ static int link_stop_clients(Link *link) {
>                  }
>          }
>  
> +        if (link->network->dhcp6) {
> +                assert(link->dhcp6_client);
> +
> +                k = sd_dhcp6_client_stop(link->dhcp6_client);
> +                if (k < 0) {
> +                        log_warning_link(link, "Could not stop DHCPv6 "
> +                                         "client: %s", strerror(-r));

> +                        log_warning_link(link, "could not acquire DHCPv6 "
> +                                         "lease");

> +                                        log_warning_link(link, "Could not "
> +                                                         "update MAC address "
> +                                                         "in DHCPv6 client: %s",
> +                                                         strerror(-r));

Those multi-line strings are both hard to read, and hard to grep for,
when looking for the source of an error messsage. Normally the line
length restrictions are better ignored for "single line" message
strings.

Zbyszek


More information about the systemd-devel mailing list