[patch] fix order of dhclient-script use

Peter Marschall peter at adpm.de
Sun Jan 16 17:29:05 UTC 2011


Hi,

the other day I stumbled over an issue with dhclient's behaviour related to 
the order used to get dhclient-script.

Here's the current logic:
	if the "script" parameter in dhclient.conf is not given
		1) value of command-line option "-sf"
		2) value of the environment variable "PATH_DHCLIENT_SCRIPT"
		3) default value as of compile time
	else
		1) value of dhclient.conf's "script" parameter

Combined into one list, this boils down to
	1) value of dhclient.conf's "script" parameter
	2) value of command-line option "-sf"
	3) value of the environment variable "PATH_DHCLIENT_SCRIPT"
	4) default value as of compile time

I guess this is against most people's expectations, which expect
command line options and maybe environment variables to override
values set in a configuration file.

In addition to people's expectations, the current order causes real
problems. 
E.g. it makes NetworkManager fail when the "script" parameter
is set in dhclient.conf.
Reason: NetworkManager calls dhclient with command-line option -sf
and a private dhclient-script, which in the current precedence order
is never used if dhclient.conf has the "script" parameter set.


The attached patch changes the precedence of the various possibilities
to get dhclient-script to the precedence order below:
	1) value of command-line option "-sf"
	2) value of the environment variable "PATH_DHCLIENT_SCRIPT"
	3) value of dhclient.conf's "script" parameter
	4) default value as of compile time

Please consider including it into the next release of ISC DHCP.

Best regards
Peter

-- 
Peter Marschall
peter at adpm.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dhcp-4.2.0-P2-dhclient-script_order.patch
Type: text/x-patch
Size: 3082 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20110116/de6647ed/attachment.bin>


More information about the dhcp-users mailing list