aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2012-04-24 14:37:48 -0400
committerLukas Nykryn <lnykryn@redhat.com>2012-08-03 10:53:39 +0200
commit9987361e94ec6f26e557053b27af6e43a9ee13e1 (patch)
tree192518ff1352629e52beadd187b39d2613eef376 /sysconfig
parentf718936169f4385d844c9415de45e5009381170f (diff)
downloadinitscripts-9987361e94ec6f26e557053b27af6e43a9ee13e1.tar
initscripts-9987361e94ec6f26e557053b27af6e43a9ee13e1.tar.gz
initscripts-9987361e94ec6f26e557053b27af6e43a9ee13e1.tar.bz2
initscripts-9987361e94ec6f26e557053b27af6e43a9ee13e1.tar.xz
initscripts-9987361e94ec6f26e557053b27af6e43a9ee13e1.zip
Allow dhclient configuration files for DHCPv6 as well. (#815676)
Conflicts: sysconfig/network-scripts/ifup-eth sysconfig/network-scripts/network-functions
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 d3adb143..ea9de5f6 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -176,15 +176,7 @@ if [ -n "${DYNCONFIG}" -a -x /sbin/dhclient ]; then
else
ONESHOT="-1";
fi;
- # allow users to use generic '/etc/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
# copy any lease obtained by the initrd
for file in /dev/.dhclient-${DEVICE}.leases /dev/.initramfs/net.${DEVICE}.lease ; do
if [ -f "${file}" ]; then
@@ -299,7 +291,8 @@ fi
# IPv6 initialisation?
/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG}
if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then
- /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} -lf /var/lib/dhclient/dhclient6-${DEVICE}.leases -pf /var/run/dhclient6-${DEVICE}.pid ${DHCP_HOSTNAME:+-H $DHCP_HOSTNAME} ${DEVICE}
+ generate_config_file_name 6
+ /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient6-${DEVICE}.leases -pf /var/run/dhclient6-${DEVICE}.pid ${DHCP_HOSTNAME:+-H $DHCP_HOSTNAME} ${DEVICE}
fi
exec /etc/sysconfig/network-scripts/ifup-post ${CONFIG} ${2}
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index e0d5018c..a3833463 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -59,6 +59,17 @@ get_uuid_by_config ()
dbus-send --system --print-reply --dest=com.redhat.ifcfgrh1 /com/redhat/ifcfgrh1 com.redhat.ifcfgrh1.GetIfcfgDetails string:"/etc/sysconfig/network-scripts/$1" 2>/dev/null | awk -F '"' '/string / { print $2 }'
}
+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