projects
/
openwrt-14.07
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BB: base-files: /lib/functions/network.sh: fix network_get_ipaddr6
[openwrt-14.07/.git]
/
package
/
base-files
/
files
/
lib
/
functions
/
network.sh
diff --git
a/package/base-files/files/lib/functions/network.sh
b/package/base-files/files/lib/functions/network.sh
index 86ab8905f1477f1e2ef5655dba75f5c345980a70..f4cf2b53447148f169179b6a1df3c9f971cddb67 100644
(file)
--- a/
package/base-files/files/lib/functions/network.sh
+++ b/
package/base-files/files/lib/functions/network.sh
@@
-29,7
+29,18
@@
network_get_ipaddr() {
# 1: destination variable
# 2: interface
network_get_ipaddr6() {
# 1: destination variable
# 2: interface
network_get_ipaddr6() {
- __network_ifstatus "$1" "$2" "['ipv6-address'][0].address";
+ local __addr
+
+ if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][0].address"; then
+ case "$__addr" in
+ *:) export "$1=${__addr}1" ;;
+ *) export "$1=${__addr}" ;;
+ esac
+ return 0
+ fi
+
+ unset $1
+ return 1
}
# determine first IPv4 subnet of given logical interface
}
# determine first IPv4 subnet of given logical interface