Skip to content

IPv4-Mapped IPv6 Addresses formatting change #1159

@colin-pm

Description

@colin-pm

Hello,

I noticed a change between python-zeroconf versions 0.47 and 0.56 where the format of IPv4-Mapped IPv6 addresses parsed from AAAA records changed. A reference for IPv4-mapped IPv6 address can be found linked below:
http://mars.tekkom.dk/w/index.php/IPv4-Mapped_IPv6_Address#:~:text=The%20IPv4%2Dmapped%20IPv6%20address%20format%20allows%20the%20IPv4%20address,is%20specified%20in%20RFC%204291

To reproduce, here is a basic callback for add_service that gets the IPv6 address:

def add_service(self, zc: Zeroconf, type_: str, name: str) -> None:
    info = zc.get_service_info(type_, name)
    if info:
        ipv6_address = next(iter(info.parsed_addresses(IPVersion.V6Only)), None)

In version 0.47 ipv6_address would be "::ffff:83.90.47.30"

In version 0.56 ipv6_address changed to "::ffff:535a:2f1e"

It appears that the octets are now in hex format and the first two octets and last two octets are combined.

I would appreciate some help understanding if this change is expected or not in the changes added between versions 0.47 and 0.56.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions