NetworkManager/src/core/devices/ovs
Beniamino Galvani 50da988182 ovs: fix assertion failure in netdev datapath mode
When using the netdev datapath, we wait for the link to appear in
different steps:

 1. initially, in act_stage3_ip_config() connects to platform's
   "link-changed" signal to detect when the TUN interface appears;

 2. when the interface appears, _netdev_tun_link_cb() schedules
   _set_ip_ifindex_tun() in a idle handler;

 3. _set_ip_ifindex_tun() checks if the link is ready (e.g. if the MAC
   address is correct) and in that case it reschedules stage3, which
   will move forward with the activation;

 4. if the link is not ready in _set_ip_ifindex_tun(), the function
   connects again to platform's "link-changed" signal to react to link
   changes;

 5. after the link changes and it is ready, _netdev_tun_link_cb()
   reschedules stage3, which moves forward with the activation;

With the current implementation it is possible that after step 2, if
act_stage3_ip_config() runs because it was already scheduled, it
registers again to the "link-changed" event; then when
_set_ip_ifindex_tun() is invoked it will hit assertion:

  nm_assert(!priv->wait_link.tun_link_signal_id);

Fix this by preventing that the signal gets registered again after
step 2.

Fixes-test: @ovs_datapath_type_netdev_with_cloned_mac

Fixes: acf485196c ('ovs-interface: wait that the cloned MAC changes instead of setting it')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2024
(cherry picked from commit b6e69f3467)
2024-09-16 12:40:03 +02:00
..
meson.build all: change G_LOG_DOMAIN to "nm" 2021-02-18 19:46:57 +01:00
nm-device-ovs-bridge.c src: drop most slave references from the code 2024-08-09 15:47:32 +02:00
nm-device-ovs-bridge.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-ovs-interface.c ovs: fix assertion failure in netdev datapath mode 2024-09-16 12:40:03 +02:00
nm-device-ovs-interface.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-ovs-port.c core: rename NM_DEVICE_MANAGED_TYPE_MANAGED to _TYPE_FULL 2024-08-28 15:35:56 +02:00
nm-device-ovs-port.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-ovs-factory.c utils: rename NM_SETTINGS_AUTO_CONNECT_* to NM_SETTINGS_AUTOCONNECT_* 2023-02-23 09:12:43 +01:00
nm-ovsdb.c ovs: allow specifying a system OVS interface by MAC address 2024-06-20 17:02:01 +02:00
nm-ovsdb.h ovs: add support for "other_config" settings 2023-01-11 21:49:36 +01:00