aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhiqiang Liu <liuzhiqiang26@huawei.com>2019-02-12 20:58:06 +0800
committerLukáš Nykrýn <lnykryn@redhat.com>2019-02-12 14:14:24 +0100
commit76226a349cd65ec9b511bc68e8f3cf8c291b7057 (patch)
tree7e981a7f60a3c7949f0008473a479d30404fd550
parentbf6a9d7d1f708077bfaad8ea109ad8b4eeb69556 (diff)
downloadinitscripts-76226a3.tar
initscripts-76226a3.tar.gz
initscripts-76226a3.tar.bz2
initscripts-76226a3.tar.xz
initscripts-76226a3.zip
ifup-eth: apply PERSISTENT_DHCLIENT to IPv6 dhclient daemon
IPv6 dhclient daemon only tries one time to obtain a IPv6 address from a DHCPv6 server regardless of the setting of PERSISTENT_DHCLIENT. PERSISTENT_DHCLIENT option is only used for IPv4 dhclient daemon. With the popularization of IPv6 protocol, some users prefer setting IPv6 like IPv4. I think there are two solutions as follows, 1. adopt PERSISTENT_DHCLIENT option to both IPv4 and IPv6. 2. create a new option, such as PERSISTENT_DHCLIENT_IPV6 option, just for IPv6. The first solution does not introduce addition options, and the IPv4 and IPv6 settings are consistent. So I perfer choosing the first solution. Fixes: bf00a0048 ("Replace /var/run with /run everywhere") Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
-rwxr-xr-xnetwork-scripts/ifup-eth8
1 files changed, 7 insertions, 1 deletions
diff --git a/network-scripts/ifup-eth b/network-scripts/ifup-eth
index 73a6c834..95db3e60 100755
--- a/network-scripts/ifup-eth
+++ b/network-scripts/ifup-eth
@@ -360,7 +360,13 @@ if is_true "${DHCPV6C}" && [ -x /sbin/dhclient ]; then
echo -n $"Determining IPv6 information for ${DEVICE}..."
# Initialize the dhclient args for IPv6 and obtain the hostname options if needed:
- DHCLIENTARGS="-6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /run/dhclient6-${DEVICE}.pid ${DEVICE}"
+ if is_true "${PERSISTENT_DHCLIENT}"; then
+ ONESHOT="";
+ else
+ ONESHOT="-1";
+ fi;
+
+ DHCLIENTARGS="-6 ${ONESHOT} ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /run/dhclient6-${DEVICE}.pid ${DEVICE}"
set_hostname_options DHCLIENTARGS
if /sbin/dhclient $DHCLIENTARGS; then