summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2018-07-30 04:13:59 +0100
committerRobby Workman <rworkman@slackware.com>2018-11-25 19:27:37 -0600
commit3a273172aebf1f0566e30cefab3454a7b498fa9b (patch)
tree3aaba6fa64c7953087fc3d5fb8f8782726c99412 /rc.inet1
parent90b4dca0900c37b95a4fcfb0cff6ef87ff691aa2 (diff)
downloadslacknetsetup-3a273172aebf1f0566e30cefab3454a7b498fa9b.tar.xz
Add checks to enable -4 or -6 options to dhcpcd
This begins addressing concerns raised in af0a481ef072d220a58e Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet15
1 files changed, 5 insertions, 0 deletions
diff --git a/rc.inet1 b/rc.inet1
index 2de26df..5cb4d0c 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -175,6 +175,11 @@ if_up() {
unset DHCP_OPTIONS
declare -a DHCP_OPTIONS
# Set DHCP_OPTIONS for this interface:
+ if [ "${USE_DHCP[$i]}" = "yes" ] && [ "${USE_DHCP6[$i]}" != "yes" ]; then # only try v4 dhcp
+ DHCP_OPTIONS+=("-4")
+ elif [ "${USE_DHCP[$i]}" != "yes" ] && [ "${USE_DHCP6[$i]}" = "yes" ]; then # only try v6 dhcp
+ DHCP_OPTIONS+=("-6")
+ fi
[ -n "${DHCP_HOSTNAME[$i]}" ] && DHCP_OPTIONS+=("-h" "${DHCP_HOSTNAME[$i]}")
[ "${DHCP_KEEPRESOLV[$i]}" = "yes" ] && DHCP_OPTIONS+=("-C" "resolv.conf")
[ "${DHCP_KEEPNTP[$i]}" = "yes" ] && DHCP_OPTIONS+=("-C" "ntp.conf")