net.lo: allow address families to be set on routes

X-Gentoo-Bug: 447310
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?d=447310
This commit is contained in:
Mihai Moldovan 2012-12-20 16:02:11 -06:00 committed by William Hubbs
parent e0bbe8d0bd
commit a61fdd019e

View File

@ -650,12 +650,19 @@ ${routes}"
local OIFS="${IFS}" SIFS="${IFS-y}" local OIFS="${IFS}" SIFS="${IFS-y}"
local IFS="$__IFS" local IFS="$__IFS"
local fam
for cmd in ${routes}; do for cmd in ${routes}; do
unset IFS unset IFS
if ${first}; then if ${first}; then
first=false first=false
einfo "Adding routes" einfo "Adding routes"
fi fi
case ${cmd} in
-6" "*) fam="-6"; cmd=${cmd#-6 };;
-4" "*) fam="-4"; cmd=${cmd#-4 };;
esac
eindent eindent
ebegin ${cmd} ebegin ${cmd}
# Work out if we're a host or a net if not told # Work out if we're a host or a net if not told
@ -668,10 +675,10 @@ ${routes}"
*) cmd="-host ${cmd}";; *) cmd="-host ${cmd}";;
esac esac
if ${hidefirstroute}; then if ${hidefirstroute}; then
_add_route ${cmd} >/dev/null 2>&1 _add_route ${fam} ${cmd} >/dev/null 2>&1
hidefirstroute=false hidefirstroute=false
else else
_add_route ${cmd} >/dev/null _add_route ${fam} ${cmd} >/dev/null
fi fi
eend $? eend $?
eoutdent eoutdent