Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/netifrc:master commit in: net/
Date: Wed, 28 Aug 2013 16:59:53
Message-Id: 1377708613.d0a28ef9f91d74678fb8c40e66a63bacc9f01bac.robbat2@OpenRC
1 commit: d0a28ef9f91d74678fb8c40e66a63bacc9f01bac
2 Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me>
3 AuthorDate: Wed Aug 28 16:50:13 2013 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 28 16:50:13 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=d0a28ef9
7
8 ifconfig: support ipv6 routes without default prefix.
9
10 ifconfig module does not support IPv6 routes without
11 default prefix, eg "-net ::/0"
12
13 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
14 X-Gentoo-Bug: 442594
15
16 ---
17 net/ifconfig.sh.Linux.in | 8 +++++---
18 1 file changed, 5 insertions(+), 3 deletions(-)
19
20 diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in
21 index 2afa66c..b2203cb 100644
22 --- a/net/ifconfig.sh.Linux.in
23 +++ b/net/ifconfig.sh.Linux.in
24 @@ -208,9 +208,11 @@ _add_route()
25 set -- "${one}" "${two}" gw "$@"
26 fi
27
28 - case "$@" in
29 - *:*|default*) [ "$1" = "-net" -o "$1" = "-host" ] && shift;;
30 - esac
31 + if [ "$1" = "-net" -o "$1" = "-host" ]; then
32 + if [ "${2##*:}" != "$2" ]; then shift
33 + elif [ "$2" = "default" ]; then shift
34 + fi
35 + fi
36
37 route ${family} add "$@" dev "${IFACE}"
38 }