summaryrefslogtreecommitdiff
path: root/package/base-files/files/lib/functions/network.sh
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-01-21 18:54:58 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-01-21 18:54:58 +0000
commit3b2db1838aa78a7c0ce22375dda5d730fd086035 (patch)
tree0f8c32d528b49907cd1296c1d9816396a94d1ad6 /package/base-files/files/lib/functions/network.sh
parent4e8eced06a3fd7e6fde088361412d2848d2d5d17 (diff)
downloadmtk-20170518-3b2db1838aa78a7c0ce22375dda5d730fd086035.zip
mtk-20170518-3b2db1838aa78a7c0ce22375dda5d730fd086035.tar.gz
mtk-20170518-3b2db1838aa78a7c0ce22375dda5d730fd086035.tar.bz2
base-files: network.sh: simplify network_get_prefix6()
SVN-Revision: 35286
Diffstat (limited to 'package/base-files/files/lib/functions/network.sh')
-rw-r--r--package/base-files/files/lib/functions/network.sh11
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 8f87d1d..86b6fc5 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 $?
}