mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-18 10:46:41 +00:00
base-files: network.sh: simplify network_get_prefix6()
SVN-Revision: 35286
This commit is contained in:
parent
4e8eced06a
commit
3b2db1838a
@ -186,18 +186,15 @@ network_get_subnet6() { __network_ipaddr "$1" "$2" 6 1; }
|
|||||||
|
|
||||||
# determine IPv6 prefix
|
# determine IPv6 prefix
|
||||||
network_get_prefix6() {
|
network_get_prefix6() {
|
||||||
local __prefix="$1"
|
local __var="$1"
|
||||||
local __iface="$2"
|
local __iface="$2"
|
||||||
local __address
|
local __address
|
||||||
local __mask
|
local __mask
|
||||||
|
|
||||||
__network_parse_ifstatus "$__iface" || return 1
|
__network_parse_ifstatus "$__iface" || return 1
|
||||||
__network_export __address "${__iface}_prefix6_address"
|
__network_export __mask "${__iface}_prefix6_mask" || return 1
|
||||||
local return="$?"
|
__network_export __var "${__iface}_prefix6_address" "$__mask"
|
||||||
[ "$return" -eq 0 ] || return $?
|
return $?
|
||||||
__network_export __mask "${__iface}_prefix6_mask"
|
|
||||||
eval "$__prefix=$__address/$__mask"
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user