mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
List more private and link-local IP networks (#74064)
List more private and link-local IP networks The IPv6 link-local network is especially important as without it local accounts don't work on IPv6-capable networks with no IPv6 DHCP server.
This commit is contained in:
@@ -30,7 +30,9 @@ def test_is_private():
|
||||
def test_is_link_local():
|
||||
"""Test link local addresses."""
|
||||
assert network_util.is_link_local(ip_address("169.254.12.3"))
|
||||
assert network_util.is_link_local(ip_address("fe80::1234:5678:abcd"))
|
||||
assert not network_util.is_link_local(ip_address("127.0.0.1"))
|
||||
assert not network_util.is_link_local(ip_address("::1"))
|
||||
|
||||
|
||||
def test_is_invalid():
|
||||
@@ -43,7 +45,13 @@ def test_is_local():
|
||||
"""Test local addresses."""
|
||||
assert network_util.is_local(ip_address("192.168.0.1"))
|
||||
assert network_util.is_local(ip_address("127.0.0.1"))
|
||||
assert network_util.is_local(ip_address("fd12:3456:789a:1::1"))
|
||||
assert network_util.is_local(ip_address("fe80::1234:5678:abcd"))
|
||||
assert network_util.is_local(ip_address("::ffff:192.168.0.1"))
|
||||
assert not network_util.is_local(ip_address("208.5.4.2"))
|
||||
assert not network_util.is_local(ip_address("198.51.100.1"))
|
||||
assert not network_util.is_local(ip_address("2001:DB8:FA1::1"))
|
||||
assert not network_util.is_local(ip_address("::ffff:208.5.4.2"))
|
||||
|
||||
|
||||
def test_is_ip_address():
|
||||
|
||||
Reference in New Issue
Block a user