Use ULA for WebUI link

For v2-hoods, the ULA should be used, which enables routing across
hoods.

Fixes #72

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2017-10-14 15:10:02 +02:00
parent 547416ae9c
commit 3d4d005a17
1 changed files with 3 additions and 0 deletions

View File

@ -180,6 +180,9 @@ def webui_addr(router_netifs):
try:
for br_mesh in filter(lambda n: n["name"] == "br-mesh", router_netifs):
for ipv6 in br_mesh["ipv6_addrs"]:
if ipv6.startswith("fd") and len(ipv6) > 25:
# This selects the first ULA address, if present
return ipv6
if ipv6.startswith("fdff") and len(ipv6) > 15 and len(ipv6) <= 20:
return ipv6
except (KeyError, TypeError):