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

Fuzz IP.Is<property>() methods against stdlib net.IP equivalents #182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

moreati
Copy link
Contributor

@moreati moreati commented May 24, 2021

The intent is to find discrepancies between netaddr.IP and net.IP. These don't necessarily indicate a bug (in either), but it's better to find them and explicitly document/exclude them.

@moreati
Copy link
Contributor Author

moreati commented May 24, 2021

Found 4 cases, again I'm not sure if a discrepancy is a bug or a facet I've not understood.

:~/src/netaddr main(+163/-2)+± head -n1 crashers/*.quoted
==> crashers/27d12f56611c1d8c7b9b43548301cedccf204a9a.quoted <==
	"::ffff:e000:0"

==> crashers/28e6412b5bf60a7c02fb854dc9db7e6bd1102bfe.quoted <==
	"::ffff:e00f:0"

==> crashers/3d78408db5a58a0c2ce3e5d61d07ad18ef72e243.quoted <==
	"::ffff:7f00:0"

==> crashers/5abca428b93502d9c5c35fba2dad0207ce42addb.quoted <==
	"feb0::0"

crashers.zip

@moreati moreati force-pushed the fuzz-properties branch from a452640 to 7a542c8 Compare May 24, 2021 20:21
Copy link
Collaborator

@josharian josharian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Please file issues for the mismatches so that we can discuss there.

Happy to merge this (with minor tweaks) once we've either fixed the underlying issues or tweaked the fuzz function to account for the legitimate mismatches. (I hope it's the former.)

fuzz.go Outdated Show resolved Hide resolved
fuzz.go Outdated Show resolved Hide resolved
The intent is to find discrepancies between netaddr.IP and net.IP. These
don't necessarily indicate a bug (in either), but it's better to find
them and explicitly document/exclude them.

Signed-off-by: Alex Willmer <[email protected]>
@moreati moreati force-pushed the fuzz-properties branch from 7a542c8 to 0bd5eca Compare May 25, 2021 19:24
@moreati
Copy link
Contributor Author

moreati commented May 25, 2021

Test jig for inspecting discrepancies https://play.golang.org/p/u7C8wFvPSA4

@josharian
Copy link
Collaborator

@moreati I just discovered this was still open and unmerged. Sorry about that. Any reason I shouldn't merge now?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants