core: better handle DHCP expiry/nak during initial lease acquisition (bgo #739482)

System Internals / NetworkManager - Dan Williams [redhat.com] - 12 December 2014 11:00 UTC

When dhclient trieds to request a previous lease and the server NAKs that lease, dhclient emits the EXPIRE state. dhcpcd has also been known to emit the 'nak' state for the same reason.

(systemd's DHCP client code does not push a NAK up to NetworkManager, but jumps to the REBOOT state instead, so it is unaffected by this issue.)

NetworkManager saw the expire during IP configuration and treated that as full activation failure. The connection would be restarted, the same lease requested, and the same NAK delivered, over and over. Before a lease is acquired, there is (by definition) no lease to expire, so these events should be ignored.

We do, however, still want to handle abnormal failures, which is why this patch splits the EXPIRE case from the FAIL case and handles them separately.

https://bugzilla.gnome.org/show_bug.cgi?id=739482

1172178 core: better handle DHCP expiry/nak during initial lease acquisition (bgo #739482)
src/devices/nm-device.c | 12 ++++++++++--
src/dhcp-manager/nm-dhcp-client.c | 12 ++++++++----
src/dhcp-manager/nm-dhcp-client.h | 9 +++++----
src/dhcp-manager/nm-dhcp-systemd.c | 2 ++
4 files changed, 25 insertions(+), 10 deletions(-)

Upstream: cgit.freedesktop.org


  • Share