From 879e1acd5dc04eee1f7b0cb49d9c1a84e28c525c Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Tue, 13 Dec 2011 00:43:18 -0800 Subject: 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 --- net/ifconfig.sh.Linux.in | 6 ++++++ net/iproute2.sh | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'net') diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in index 1ac0dd5..80a0b98 100644 --- a/net/ifconfig.sh.Linux.in +++ b/net/ifconfig.sh.Linux.in @@ -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 diff --git a/net/iproute2.sh b/net/iproute2.sh index 4e7e88c..c8f670c 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -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 -- cgit v1.2.3