From 3a273172aebf1f0566e30cefab3454a7b498fa9b Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Mon, 30 Jul 2018 04:13:59 +0100 Subject: Add checks to enable -4 or -6 options to dhcpcd This begins addressing concerns raised in af0a481ef072d220a58e Signed-off-by: Robby Workman --- rc.inet1 | 5 +++++ 1 file changed, 5 insertions(+) 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") -- cgit v1.2.3