DHCPv6: don't kill dhclient when address is depreferred bug748268-DEPREF6
authorTJ <gnome@iam.tj>
Thu, 31 Mar 2016 15:02:57 +0000 (16:02 +0100)
committerTJ <gnome@iam.tj>
Thu, 31 Mar 2016 15:45:30 +0000 (16:45 +0100)
commit84ca52aeca9210cde1af379d4f11c75d62ae78ad
treeb831e31e27794304badd7c9bf0a8a651011dc24e
parent28e9ec499a7517f35cc5093e9b545302094e55d4
DHCPv6: don't kill dhclient when address is depreferred

Teach Network Manager how to handle the DEPREFER dhclient state.

Network Manager summarily kills the IPv6 dhclient process when the
DHCPv6 lease contained in the dhclient6-${UUID}.lease file is out-of date, leaving
the IPv6 interface without a stateful IPv6 address, or, if the "require IPv6 address on
this interface" option is enabled, causes NM to cycle continuously deactivating and
reactivating the interface (including the IPv4 addresses).

This is effectively a Denial Of Service. It can be trivially induced if,
for example, the dhclient6-$(UUID}.lease file contains a lease that was issued before the
user went away on vacation or the PC wasn't connected to the same network for a few
days (depending on the lease renew/rebind/expiry times). Calculation on the old lease of

start + preferred_lifetime < NOW

triggers dhclient to 'DEPREFER6' the lease (withdraw the address record)
and ask the DHCPv6 server for a new lease, but Network Manager will kill the
dhclient because it only sees an 'EXPIRE6' state change.

Signed-off-by: TJ <gnome@iam.tj>
src/devices/nm-device.c
src/dhcp-manager/nm-dhcp-client.c
src/dhcp-manager/nm-dhcp-client.h