X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fnetwork%2Fnetworkd-link.c;h=f716e8231a111d90e5a7f03a392d985dbcb1a17b;hb=5c3072eab6d2e11d89452987b017541d4654ac05;hp=3b9881d71e57c88825f580e11596f1c225d5a060;hpb=d0d6a4cd70477970812bff0a37e70f66208d7c14;p=elogind.git diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 3b9881d71..f716e8231 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -728,12 +728,12 @@ int link_address_drop_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) return 1; } -static int link_set_bridge_fdb(const Link *const link) { +static int link_set_bridge_fdb(Link *const link) { FdbEntry *fdb_entry; int r = 0; LIST_FOREACH(static_fdb_entries, fdb_entry, link->network->static_fdb_entries) { - r = fdb_entry_configure(link->manager->rtnl, fdb_entry, link->ifindex); + r = fdb_entry_configure(link, fdb_entry); if(r < 0) { log_link_error(link, "Failed to add MAC entry to static MAC table: %s", strerror(-r)); break; @@ -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); @@ -1097,36 +1098,43 @@ static int link_up(Link *link) { } } - if (!link_ipv6ll_enabled(link)) { - r = sd_rtnl_message_open_container(req, IFLA_AF_SPEC); - if (r < 0) { - log_link_error(link, "Could not open IFLA_AF_SPEC container: %s", strerror(-r)); - return r; - } + r = sd_rtnl_message_open_container(req, IFLA_AF_SPEC); + if (r < 0) { + log_link_error(link, "Could not open IFLA_AF_SPEC container: %s", strerror(-r)); + return r; + } - r = sd_rtnl_message_open_container(req, AF_INET6); - if (r < 0) { - log_link_error(link, "Could not open AF_INET6 container: %s", strerror(-r)); - return r; - } + r = sd_rtnl_message_open_container(req, AF_INET6); + if (r < 0) { + log_link_error(link, "Could not open AF_INET6 container: %s", strerror(-r)); + return r; + } - 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; + } - r = sd_rtnl_message_close_container(req); + if (!in_addr_is_null(AF_INET6, &link->network->ipv6_token)) { + r = sd_rtnl_message_append_in6_addr(req, IFLA_INET6_TOKEN, &link->network->ipv6_token.in6); if (r < 0) { - log_link_error(link, "Could not close AF_INET6 contaire: %s", strerror(-r)); + log_link_error(link, "Could not append IFLA_INET6_TOKEN: %s", strerror(-r)); return r; } + } - r = sd_rtnl_message_close_container(req); - if (r < 0) { - log_link_error(link, "Could not close IFLA_AF_SPEC contaire: %s", strerror(-r)); - return r; - } + r = sd_rtnl_message_close_container(req); + if (r < 0) { + log_link_error(link, "Could not close AF_INET6 container: %s", strerror(-r)); + return r; + } + + r = sd_rtnl_message_close_container(req); + if (r < 0) { + log_link_error(link, "Could not close IFLA_AF_SPEC container: %s", strerror(-r)); + return r; } r = sd_rtnl_call_async(link->manager->rtnl, req, link_up_handler, link,