network: stop to assign UUID when reconfiguring link

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.
This commit is contained in:
Yu Watanabe 2020-11-24 15:47:13 +09:00
parent f63e09ef75
commit 59c31eba49
1 changed files with 1 additions and 0 deletions

View 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);