aboutsummaryrefslogtreecommitdiff
path: root/net/iproute2.sh
diff options
context:
space:
mode:
Diffstat (limited to 'net/iproute2.sh')
-rw-r--r--net/iproute2.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/iproute2.sh b/net/iproute2.sh
index 9901aae5..953bae25 100644
--- a/net/iproute2.sh
+++ b/net/iproute2.sh
@@ -131,6 +131,13 @@ _add_address()
_add_route()
{
+ local family=
+
+ if [ "$1" = "-A" -o "$1" = "-f" -o "$1" = "-family" ]; then
+ family="-f $2"
+ shift; shift
+ fi
+
if [ $# -eq 3 ]; then
set -- "$1" "$2" via "$3"
elif [ "$3" = "gw" ]; then
@@ -145,7 +152,6 @@ _add_route()
metric) cmd="${cmd} $1"; have_metric=true;;
netmask) cmd="${cmd}/$(_netmask2cidr "$2")"; shift;;
-host|-net);;
- -A) [ "$2" = "inet6" ] && shift;;
*) cmd="${cmd} $1";;
esac
shift
@@ -155,7 +161,7 @@ _add_route()
cmd="${cmd} metric ${metric}"
fi
- ip route append ${cmd} dev "${IFACE}"
+ ip ${family} route append ${cmd} dev "${IFACE}"
eend $?
}