Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 262097 | Differences between
and this patch

Collapse All | Expand All

(-)a/dhcpcd.sh (-20 / +34 lines)
Lines 66-92 dhcpcd_start() { Link Here
66
	interface_exists "${iface}" true || return 1
66
	interface_exists "${iface}" true || return 1
67
67
68
	# Get our options
68
	# Get our options
69
	opts="dhcpcd_${ifvar}"
69
	eval opts=\$dhcp_${ifvar}
70
	opts="${dhcpcd} ${!opts}"
70
	[ -z "${opts}" ] && opts=${dhcp}
71
71
72
	# Map some generic options to dhcpcd
72
	case "$(dhcpcd --version)" in
73
	d="dhcp_${ifvar}"
73
		"dhcpcd "[123]*) new=false;;
74
	d=" ${!d} "
74
	esac
75
	[[ ${d} == "  " ]] && d=" ${dhcp} "
75
76
	[[ ${d} == *" nodns "* ]] && opts="${opts} -R"
76
    # Map some generic options to dhcpcd
77
	[[ ${d} == *" nontp "* ]] && opts="${opts} -N"
77
	for opt in ${opts}; do
78
	[[ ${d} == *" nonis "* ]] && opts="${opts} -Y"
78
		case "${opt}" in
79
	[[ ${d} == *" nogateway "* ]] && opts="${opts} -G"
79
			nodns)
80
	if [[ ${d} == *" nosendhost "* ]] ; then
80
				if ${new}; then
81
		opts="${opts} -h ''"
81
					opts="${opts} -C resolv.conf"
82
	else
82
				else
83
		# We transmit the hostname by default
83
					opts="${opts} -R"
84
		if [[ " ${opts} " != *" -h "* ]]; then
84
				fi
85
			local hname=$(hostname)
85
				;;
86
			[[ -n ${hname} && ${hname} != "(none)" && ${hname} != "localhost" ]] \
86
			nontp)
87
				&& opts="-h \"${hname}\" ${opts}"
87
				if ${new}; then
88
		fi
88
					opts="${opts} -C ntp.conf"
89
	fi
89
				else
90
					opts="${opts} -N"
91
				fi
92
				;;
93
			nonis)
94
				if ${new}; then
95
					opts="${opts} -C yp.conf"
96
				else
97
					opts="${opts} -Y"
98
				fi
99
				;;
100
			nogateway) opts="${opts} -G";;
101
			nosendhost) opts="${opts} -h ''";
102
		esac
103
	done
90
104
91
	# Add our route metric
105
	# Add our route metric
92
	metric="metric_${ifvar}"
106
	metric="metric_${ifvar}"

Return to bug 262097