aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2012-12-20 16:02:11 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2012-12-20 16:02:11 -0600
commita61fdd019ee8715689ce07abeda25e6961a4754f (patch)
treeaf60701d9dcfae3b344966da65fbb7a5a1e6145f
parente0bbe8d0bde82b14aa9a867707298c2040442151 (diff)
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
-rw-r--r--init.d/net.lo.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index 51833f28..db6550d2 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -650,12 +650,19 @@ ${routes}"
local OIFS="${IFS}" SIFS="${IFS-y}"
local IFS="$__IFS"
+ local fam
for cmd in ${routes}; do
unset IFS
if ${first}; then
first=false
einfo "Adding routes"
fi
+
+ case ${cmd} in
+ -6" "*) fam="-6"; cmd=${cmd#-6 };;
+ -4" "*) fam="-4"; cmd=${cmd#-4 };;
+ esac
+
eindent
ebegin ${cmd}
# Work out if we're a host or a net if not told
@@ -668,10 +675,10 @@ ${routes}"
*) cmd="-host ${cmd}";;
esac
if ${hidefirstroute}; then
- _add_route ${cmd} >/dev/null 2>&1
+ _add_route ${fam} ${cmd} >/dev/null 2>&1
hidefirstroute=false
else
- _add_route ${cmd} >/dev/null
+ _add_route ${fam} ${cmd} >/dev/null
fi
eend $?
eoutdent