net: Support more variants of address family specification.

This includes address family specifications methods to help debug bug
358235 further.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
Robin H. Johnson 2011-12-13 00:43:18 -08:00
parent 06f6ce408c
commit 879e1acd5d
2 changed files with 13 additions and 4 deletions

View File

@ -188,6 +188,12 @@ _add_route()
if [ "$1" = "-A" -o "$1" = "-f" -o "$1" = "-family" ]; then
family="-A $2"
shift; shift
elif [ "$1" = "-4" ]; then
family="-A inet"
shift
elif [ "$1" = "-6" ]; then
family="-A inet6"
shift
fi
if [ -n "${metric}" ]; then

View File

@ -149,6 +149,12 @@ _add_route()
if [ "$1" = "-A" -o "$1" = "-f" -o "$1" = "-family" ]; then
family="-f $2"
shift; shift
elif [ "$1" = "-4" ]; then
family="-f inet"
shift
elif [ "$1" = "-6" ]; then
family="-f inet6"
shift
fi
if [ $# -eq 3 ]; then
@ -212,10 +218,7 @@ _trim() {
# This allows for advanced routing tricks
_ip_rule_runner() {
local cmd rules OIFS="${IFS}" family
if [ "x$1" = "-4" ]; then
family="$1"
shift
elif [ "x$1" = "-6" ]; then
if [ "$1" = "-4" -o "$1" = "-6" ]; then
family="$1"
shift
else