Let me know if I'm doing it wrong, but...
root@EA8500:~# . /lib/functions/network.sh
root@EA8500:~# network_get_ipaddr6 ipv6wan wan; echo $ipv6wan
root@EA8500:~# ifconfig eth0.2
eth0.2 Link encap:Ethernet HWaddr **:**:**:**:**:**
inet addr:**.***.***.*** Bcast:**.**.***.*** Mask:255.255.255.224
inet6 addr: fe80::****:****:****:***/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13671531 errors:0 dropped:0 overruns:0 frame:0
TX packets:10265232 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20899685116 (19.4 GiB) TX bytes:1691274934 (1.5 GiB)
So howcome I'm not getting that inet6 addr thru network_get_ipaddr6?
PS. Can't get it to format properly with discourse -- it should be one big blockquote.