Return correct timer in __ni_timer_disarm

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Release DHCP4 lease only if DHCLIENT_RELEASE_BEFORE_QUIT is set

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Use ni_log_facility instead of referencing ni_debug

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Add ni_debug_timer to trace internal timer

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Use ni_debug_timer instead of ni_debug_socket

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Add ni_debug_timer calls

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Convert DHCP4 fsm state to enum to catch all states

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Replace if lists with switch to catch all DHCP4 states

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Remove fsm state change from ni_dhcp4_device_drop_lease

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Clear DHCP4 fsm.timer in timeout callback

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Handle DHCP4 defer-timeout (DHCLIENT_WAIT_AT_BOOT)

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Handle DHCP4 start-delay (DHCLIENT_SLEEP)

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Randomize DHCP4 startup delay as suggested in RFC2131

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Merge pull request #394 from olafhering/olh-misc

DHCP4 changes (bnc#866994)
nanny: reset worker on enable(), disable()

rearming is not enough as often reseting internal fsm
is mandatory.
debugging: lowered timer debug messages to debug2
Merge pull request #395 from mtomaschewski/timer-debug

debugging: lowered timer debug messages to debug2
debugging: fixed last commit to use right arg order
Introduce xml_node_new_element_unique(name, parent, cdata)

This function ensures that a child element named @name exists and
sets its cdata to @cdata.

It can be used to replace code like this:

	if (!(e = xml_node_get_child(node, "state")))
		e = xml_node_new("state", node);
	xml_node_set_cdata(e, opt_state);

with

	e = xml_node_new_element_unique("state", opt_state, node);

Signed-off-by: Olaf Kirch <okir@suse.de>
Change do_lease() to use new xml_new_element_unique fctn

Signed-off-by: Olaf Kirch <okir@suse.de>