Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 85659
Collapse All | Expand All

(-)net.eth0 (+19 lines)
Lines 126-131 Link Here
126
				ifconfig ${IFACE} ${ifconfig_fallback_IFACE} >${devnull} && \
126
				ifconfig ${IFACE} ${ifconfig_fallback_IFACE} >${devnull} && \
127
				ifconfig ${IFACE} up &>${devnull}
127
				ifconfig ${IFACE} up &>${devnull}
128
				eend $? || return $?
128
				eend $? || return $?
129
				if [[ ${gateway_fallback} == ${IFACE}/* ]]; then
130
					local ogw=$(/bin/netstat -rn | awk '$1 == "0.0.0.0" {print $2}')
131
					local gw=${gateway_fallback#*/}
132
					if [[ ${ogw} != ${gw} ]]; then
133
						ebegin "  Setting fallback default gateway ($gw)"
134
135
						# First delete any existing route if it was setup by kernel...
136
						/sbin/route del default dev ${IFACE} &>${devnull}
137
138
						# Second delete old gateway if it was set...
139
						/sbin/route del default gw ${ogw} &>${devnull}
140
141
						# Third add our new default gateway
142
						/sbin/route add default gw ${gw} >${devnull}
143
						eend $? || {
144
							true # need to have some command in here
145
						}
146
					fi
147
				fi
129
			else
148
			else
130
				return $retval
149
				return $retval
131
			fi
150
			fi

Return to bug 85659