diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-01-21 18:54:58 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-01-21 18:54:58 +0000 |
commit | 4f988432cb3aae535e8dc574c42417a574a9cf94 (patch) | |
tree | 34f291f61e257ae34dea1fad1640cbe468742c08 /package/base-files/files/lib | |
parent | b4fb2a8735332fae72826982c2d4edc10b3fc4b2 (diff) | |
download | upstream-4f988432cb3aae535e8dc574c42417a574a9cf94.tar.gz upstream-4f988432cb3aae535e8dc574c42417a574a9cf94.tar.bz2 upstream-4f988432cb3aae535e8dc574c42417a574a9cf94.zip |
base-files: network.sh: simplify network_get_prefix6()
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35286 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/lib')
-rw-r--r-- | package/base-files/files/lib/functions/network.sh | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh index 8f87d1d0be..86b6fc5691 100644 --- a/package/base-files/files/lib/functions/network.sh +++ b/package/base-files/files/lib/functions/network.sh @@ -186,18 +186,15 @@ network_get_subnet6() { __network_ipaddr "$1" "$2" 6 1; } # determine IPv6 prefix network_get_prefix6() { - local __prefix="$1" + local __var="$1" local __iface="$2" local __address local __mask __network_parse_ifstatus "$__iface" || return 1 - __network_export __address "${__iface}_prefix6_address" - local return="$?" - [ "$return" -eq 0 ] || return $? - __network_export __mask "${__iface}_prefix6_mask" - eval "$__prefix=$__address/$__mask" - return 0 + __network_export __mask "${__iface}_prefix6_mask" || return 1 + __network_export __var "${__iface}_prefix6_address" "$__mask" + return $? } |