From: Tom Gundersen Date: Thu, 12 Feb 2015 13:15:41 +0000 (+0100) Subject: networkd: explicitly enable/disable ipv6ll addresses X-Git-Tag: v219~61 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=5c3072eab6d2e11d89452987b017541d4654ac05;ds=inline networkd: explicitly enable/disable ipv6ll addresses The kernel does not like getting an empty container, so just always pass the parameter, even if it is the default. --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 7b488162f..f716e8231 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1058,6 +1058,7 @@ static int link_up_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) { static int link_up(Link *link) { _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL; + uint8_t ipv6ll_mode; int r; assert(link); @@ -1109,12 +1110,11 @@ static int link_up(Link *link) { return r; } - if (!link_ipv6ll_enabled(link)) { - r = sd_rtnl_message_append_u8(req, IFLA_INET6_ADDR_GEN_MODE, IN6_ADDR_GEN_MODE_NONE); - if (r < 0) { - log_link_error(link, "Could not append IFLA_INET6_ADDR_GEN_MODE: %s", strerror(-r)); - return r; - } + ipv6ll_mode = link_ipv6ll_enabled(link) ? IN6_ADDR_GEN_MODE_EUI64 : IN6_ADDR_GEN_MODE_NONE; + r = sd_rtnl_message_append_u8(req, IFLA_INET6_ADDR_GEN_MODE, ipv6ll_mode); + if (r < 0) { + log_link_error(link, "Could not append IFLA_INET6_ADDR_GEN_MODE: %s", strerror(-r)); + return r; } if (!in_addr_is_null(AF_INET6, &link->network->ipv6_token)) {