From eb75b919e8013de2031054349fe7f778e8935f29 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Fri, 24 Aug 2018 09:49:22 -0600 Subject: [PATCH] networkd-dhcp6: Improve logging on DHCPv6 PD assignment Print out prefixes assigned to links in addition to the DHCPv6 prefix it was delegated from. --- src/network/networkd-dhcp6.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index c55fe62..0aa7a19 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -121,6 +121,7 @@ static int dhcp6_pd_prefix_distribute(Link *dhcp6_link, Iterator *i, union in_addr_union prefix; uint64_t n_prefixes, n_used = 0; _cleanup_free_ char *buf = NULL; + _cleanup_free_ char *assigned_buf = NULL; int r; assert(manager); @@ -158,19 +159,23 @@ static int dhcp6_pd_prefix_distribute(Link *dhcp6_link, Iterator *i, if (assigned_link != NULL && assigned_link != link) continue; + (void) in_addr_to_string(AF_INET6, &prefix, &assigned_buf); r = dhcp6_pd_prefix_assign(link, &prefix.in6, 64, lifetime_preferred, lifetime_valid); if (r < 0) { - log_link_error_errno(link, r, "Unable to %s prefix %s/%u for link: %m", + log_link_error_errno(link, r, "Unable to %s prefix %s/64 from %s/%u for link: %m", assigned_link ? "update": "assign", + strnull(assigned_buf), strnull(buf), pd_prefix_len); if (assigned_link == NULL) continue; } else - log_link_debug(link, "Assigned prefix %" PRIu64 "/%" PRIu64 " %s/64 to link", - n_used + 1, n_prefixes, strnull(buf)); + log_link_debug(link, "Assigned prefix %" PRIu64 "/%" PRIu64 " %s/64 from %s/%u to link", + n_used + 1, n_prefixes, + strnull(assigned_buf), + strnull(buf), pd_prefix_len); n_used++; -- 2.7.4