Bug 18574 - [PATCH] Fix parsing of IPv6 addresses
Summary: [PATCH] Fix parsing of IPv6 addresses
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-03-25 12:59 UTC by Dick Porter
Modified: 2014-05-23 11:05 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Bug fix patch (7.79 KB, patch)
2014-03-25 12:59 UTC, Dick Porter

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Dick Porter 2014-03-25 12:59:37 UTC
Created attachment 6407 [details]
Bug fix patch

The IPv6 address parser misses some syntax errors, and can become confused by addresses that at first glance look IPv4 compatible.  The attach patch contains the following fixes:

Don't fail to parse an address if we mistakenly thought it was IPv4 compatible or mapped, just treat it as IPv6.

Fix IPv4-compatible and mapped address formatting in ToString().

Fix parsing of colons - specifically occurrences of ':::'.

Make sure blocks of digits are no longer than 4 characters.

Add some more parsing tests to Mono's NUnit test suite.

Add a NUnit test for bogus IPv6 addresses.
Comment 1 Marek Safar 2014-03-25 16:49:24 UTC
Could you turn this into a pull request?
Comment 2 Dick Porter 2014-03-26 04:14:05 UTC
I could push it myself if that would be easier
Comment 3 Marek Safar 2014-03-26 15:15:18 UTC
Comment 4 Miguel de Icaza [MSFT] 2014-05-23 11:05:25 UTC
It does not seem like the patch was ever committed, I hand applied it