From d0a28ef9f91d74678fb8c40e66a63bacc9f01bac Mon Sep 17 00:00:00 2001 From: Alexander Tsoy Date: Wed, 28 Aug 2013 09:50:13 -0700 Subject: ifconfig: support ipv6 routes without default prefix. ifconfig module does not support IPv6 routes without default prefix, eg "-net ::/0" Signed-off-by: Robin H. Johnson X-Gentoo-Bug: 442594 --- net/ifconfig.sh.Linux.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in index 2afa66c..b2203cb 100644 --- a/net/ifconfig.sh.Linux.in +++ b/net/ifconfig.sh.Linux.in @@ -208,9 +208,11 @@ _add_route() set -- "${one}" "${two}" gw "$@" fi - case "$@" in - *:*|default*) [ "$1" = "-net" -o "$1" = "-host" ] && shift;; - esac + if [ "$1" = "-net" -o "$1" = "-host" ]; then + if [ "${2##*:}" != "$2" ]; then shift + elif [ "$2" = "default" ]; then shift + fi + fi route ${family} add "$@" dev "${IFACE}" } -- cgit v1.2.3-65-gdbad