mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
action_utils: Drop support for link-local IPv6 addresses
Tests: - Diagnostics page for Calibre app does not show a test for link-local IPv6 address anymore. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
82d7cd0e8f
commit
185559b43f
@ -371,12 +371,13 @@ def get_addresses() -> list[dict[str, str | bool]]:
|
|||||||
'url_address': hostname
|
'url_address': hostname
|
||||||
})
|
})
|
||||||
|
|
||||||
# XXX: When a hostname is resolved to IPv6 address, it may likely
|
# When a hostname is resolved to IPv6 address, it may likely be link-local
|
||||||
# be link-local address. Link local IPv6 addresses are valid only
|
# address. Link local IPv6 addresses are valid only for a given link and
|
||||||
# for a given link and need to be scoped with interface name such
|
# need to be scoped with interface name such as '%eth0' to work. Browsers
|
||||||
# as '%eth0' to work. Tools such as curl don't seem to handle
|
# refused to implement support for link-local addresses (with zone IDs) in
|
||||||
|
# URLs due to platform specific parsing rules and other implementation
|
||||||
|
# difficulties. mod_auth_openidc does not support them either.
|
||||||
# this correctly.
|
# this correctly.
|
||||||
# addresses.append({'kind': '6', 'address': hostname, 'numeric': False})
|
|
||||||
|
|
||||||
return addresses
|
return addresses
|
||||||
|
|
||||||
@ -398,13 +399,15 @@ def get_ip_addresses() -> list[dict[str, str | bool]]:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if address['kind'] == '6' and address['numeric']:
|
if address['kind'] == '6' and address['numeric']:
|
||||||
if address['scope'] != 'link':
|
address['url_address'] = '[{0}]'.format(address['address'])
|
||||||
address['url_address'] = '[{0}]'.format(address['address'])
|
|
||||||
else:
|
|
||||||
address['url_address'] = '[{0}%{1}]'.format(
|
|
||||||
address['url_address'], address['interface'])
|
|
||||||
|
|
||||||
addresses.append(address)
|
if address['scope'] != 'link':
|
||||||
|
# Do not include link local addresses. Browsers refused to
|
||||||
|
# implement support for link-local addresses (with zone IDs) in
|
||||||
|
# URLs due to platform specific parsing rules and other
|
||||||
|
# implementation difficulties. mod_auth_openidc does not support
|
||||||
|
# them either.
|
||||||
|
addresses.append(address)
|
||||||
|
|
||||||
return addresses
|
return addresses
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user