Skip to content

device: ensure DHCP is restarted every time the link goes up

Beniamino Galvani requested to merge bg/rh2079406 into main

Currently we call nm_device_update_dynamic_ip_setup() in carrier_changed() every time the carrier goes up again and the device is activating, to kick a restart of DHCP.

Since we process link events in a idle handler, it can happen that the handler is called only once for different events; in particular device_link_changed() might be called once for a link-down/link-up sequence.

carrier_changed() is "level-triggered" - it cares only about the current carrier state. nm_device_update_dynamic_ip_setup() should instead be "edge-triggered" - invoked every time the link goes from down to up. We have a mechanism for that in device_link_changed(), use it.

Fixes-test: @ipv4_spurious_leftover_route

https://bugzilla.redhat.com/show_bug.cgi?id=2079406

Merge request reports