]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: stop to assign UUID when reconfiguring link 17707/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 24 Nov 2020 06:47:13 +0000 (15:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Dec 2020 11:31:39 +0000 (20:31 +0900)
This fixes the following race in reconfiguring link:
1. an interface requests UUID.
2. the interface is reconfigured and link_configure() is called.
3. sd-lldp client is started on the interface (it is enabled by default).
4. networkd acquires UUID, and get_product_uuid_handler() calls
   link_configure() for the link again.
5. link_lldp_rx_configure() fails to set ifindex for already running
   sd-lldp client.
6. the link enters failed state.

src/network/networkd-link.c

index 2b7055dd0fa01eb818910b296a98c1788461de28..547f3bbc0127282b7e80576e71fa311397705faf 100644 (file)
@@ -2172,6 +2172,7 @@ static int link_reconfigure_internal(Link *link, sd_netlink_message *m, bool for
         link_free_carrier_maps(link);
         link_free_engines(link);
         link->network = network_unref(link->network);
+        link_unref(set_remove(link->manager->links_requesting_uuid, link));
 
         /* Then, apply new .network file */
         r = network_apply(network, link);