aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2012-04-24 14:37:48 -0400
committerBill Nottingham <notting@redhat.com>2012-04-24 14:37:48 -0400
commit4920ccfbb5f232488f79422943dfdcac1efc5301 (patch)
tree874736d6a1b32e052c33171fa80eaf00dd143f8e /sysconfig
parent7fac4bb19bce48e827b6237a70b28065b0762421 (diff)
downloadinitscripts-4920ccfbb5f232488f79422943dfdcac1efc5301.tar
initscripts-4920ccfbb5f232488f79422943dfdcac1efc5301.tar.gz
initscripts-4920ccfbb5f232488f79422943dfdcac1efc5301.tar.bz2
initscripts-4920ccfbb5f232488f79422943dfdcac1efc5301.tar.xz
initscripts-4920ccfbb5f232488f79422943dfdcac1efc5301.zip
Allow dhclient configuration files for DHCPv6 as well. (#815676)
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth13
-rw-r--r--sysconfig/network-scripts/network-functions11
2 files changed, 14 insertions, 10 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index 9d926f23..a43d04e7 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -183,15 +183,7 @@ if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then
else
ONESHOT="-1";
fi;
- # allow users to use generic '/etc/dhcp/dhclient.conf' (as documented in manpage!)
- # if per-device file doesn't exist or is empty
- if [ -s /etc/dhcp/dhclient-${DEVICE}.conf ]; then
- DHCLIENTCONF="-cf /etc/dhcp/dhclient-${DEVICE}.conf";
- elif [ -s /etc/dhclient-${DEVICE}.conf ]; then
- DHCLIENTCONF="-cf /etc/dhclient-${DEVICE}.conf";
- else
- DHCLIENTCONF='';
- fi;
+ generate_config_file_name
generate_lease_file_name
DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${ONESHOT} -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid"
echo
@@ -300,8 +292,9 @@ fi
# IPv6 initialisation?
/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG}
if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then
+ generate_config_file_name 6
generate_lease_file_name 6
- /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE}
+ /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE}
fi
if [ "${IPX}" = yes ]; then
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 6402a7dc..044f1ea1 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -68,6 +68,17 @@ generate_lease_file_name () {
LEASEFILE="/var/lib/dhclient/dhclient$ver-${UUID}-${DEVICE}.lease"
}
+generate_config_file_name () {
+ local ver=$1
+ if [ -s /etc/dhcp/dhclient$ver-${DEVICE}.conf ]; then
+ DHCLIENTCONF="-cf /etc/dhcp/dhclient$ver-${DEVICE}.conf";
+ elif [ -s /etc/dhclient$ver-${DEVICE}.conf ]; then
+ DHCLIENTCONF="-cf /etc/dhclient$ver-${DEVICE}.conf";
+ else
+ DHCLIENTCONF='';
+ fi
+}
+
need_config ()
{
local nconfig