aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-eth
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2013-04-12 12:59:20 +0200
committerLukas Nykryn <lnykryn@redhat.com>2013-04-12 12:59:20 +0200
commit17ab37ef0a032855aaa3ce77c1765b982e903ca0 (patch)
tree6aa3d5058e29c2674f74d7c4e55eb25020ea0bcd /sysconfig/network-scripts/ifup-eth
parent47b1b79a5e8776b2100e8b55d7ab7be067e1bcd7 (diff)
downloadinitscripts-17ab37ef0a032855aaa3ce77c1765b982e903ca0.tar
initscripts-17ab37ef0a032855aaa3ce77c1765b982e903ca0.tar.gz
initscripts-17ab37ef0a032855aaa3ce77c1765b982e903ca0.tar.bz2
initscripts-17ab37ef0a032855aaa3ce77c1765b982e903ca0.tar.xz
initscripts-17ab37ef0a032855aaa3ce77c1765b982e903ca0.zip
try dhcpv6 after v4 failed
Diffstat (limited to 'sysconfig/network-scripts/ifup-eth')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth22
1 files changed, 20 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index e76d4c24..bd524343 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -172,9 +172,16 @@ if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then
if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
echo $" done."
+ dhcpipv4="good"
else
echo $" failed."
- exit 1
+ if [[ "${IPV4_FAILURE_FATAL}" = [Yy1]* ]] ; then
+ exit 1
+ fi
+ if [[ "$IPV6INIT" != [yY1]* && "$DHCPV6C" != [yY1]* ]] ; then
+ exit 1
+ fi
+ net_log "Unable to obtain IPv4 DHCP address ${DEVICE}." warning
fi
# end dynamic device configuration
else
@@ -275,7 +282,18 @@ fi
if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then
generate_config_file_name 6
generate_lease_file_name 6
- /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE}
+ echo
+ echo -n $"Determining IPv6 information for ${DEVICE}..."
+ if /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} ; then
+ echo $" done."
+ else
+ echo $" failed."
+ if [ "${dhcpipv4}" = "good" -o -n "${IPADDR}" ]; then
+ net_log "Unable to obtain IPv6 DHCP address ${DEVICE}." warning
+ else
+ exit 1
+ fi
+ fi
fi
if [ "${IPX}" = yes ]; then