diff --git a/supervisor/dbus/payloads/generate.py b/supervisor/dbus/payloads/generate.py index 7ee049cb9..caf4ced07 100644 --- a/supervisor/dbus/payloads/generate.py +++ b/supervisor/dbus/payloads/generate.py @@ -32,7 +32,9 @@ def interface_update_payload( def ipv6_to_byte(ip_address: IPv6Address) -> str: """Convert an ipv6 to an byte array.""" - return f'[byte {", ".join("0x{:02x}".format(val) for val in reversed(ip_address.packed))}]' + return ( + f'[byte {", ".join("0x{:02x}".format(val) for val in ip_address.packed)}]' + ) # Init template env.filters["ipv4_to_int"] = ipv4_to_int diff --git a/tests/dbus/payloads/test_interface_update_payload.py b/tests/dbus/payloads/test_interface_update_payload.py index 439fa12c1..69945fc37 100644 --- a/tests/dbus/payloads/test_interface_update_payload.py +++ b/tests/dbus/payloads/test_interface_update_payload.py @@ -115,6 +115,7 @@ async def test_interface_update_payload_ethernet_ipv6(coresys): interface.ipv6.nameservers = [ ip_address("2606:4700:4700::64"), ip_address("2606:4700:4700::6400"), + ip_address("2606:4700:4700::1111"), ] interface.ipv6.gateway = ip_address("fe80::da58:d7ff:fe00:9c69") @@ -130,8 +131,9 @@ async def test_interface_update_payload_ethernet_ipv6(coresys): ) assert DBus.parse_gvariant(data)["ipv6"]["address-data"][0]["prefix"] == 64 assert DBus.parse_gvariant(data)["ipv6"]["dns"] == [ - [100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 0, 71, 6, 38], - [0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 0, 71, 6, 38], + [38, 6, 71, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100], + [38, 6, 71, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0], + [38, 6, 71, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17], ] assert ( DBus.parse_gvariant(data)["connection"]["uuid"] == inet.settings.connection.uuid