Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.
This repository was archived by the owner on May 25, 2023. It is now read-only.

Is<property>() methods disagree with net.IP for 4in6 addresses #183

@moreati

Description

@moreati

For IPv4 addresses mapped to IPv6 (e.g. ::ffff:127.0.0.1) netaddr.IP methods (e.g. IsLoopback()) return false, but net.IP returns true (tested with go 1.16.4).

Given the goal of compatibility with net.IP this should probably be documented or fixed within this module. My presumption is fix, but I'm programmer, not a network expert.

This is one category found by #182.

https://play.golang.org/p/z2KVy-FsKmD

go1.16.4
                           netaddr.IP     net.IP      Discrepency
String                     ::ffff:e000:0  224.0.0.0   
IsInterfaceLocalMulticast  false          false       
IsLinkLocalMulticast       false          true        true
IsLinkLocalUnicast         false          false       
IsLoopback                 false          false       
IsMulticast                false          true        true
                           netaddr.IP     net.IP      Discrepency
String                     ::ffff:e00f:0  224.15.0.0  
IsInterfaceLocalMulticast  false          false       
IsLinkLocalMulticast       false          false       
IsLinkLocalUnicast         false          false       
IsLoopback                 false          false       
IsMulticast                false          true        true
                           netaddr.IP     net.IP      Discrepency
String                     ::ffff:7f00:1  127.0.0.1   
IsInterfaceLocalMulticast  false          false       
IsLinkLocalMulticast       false          false       
IsLinkLocalUnicast         false          false       
IsLoopback                 false          true        true
IsMulticast                false          false       

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions