Bug 18574

Summary: [PATCH] Fix parsing of IPv6 addresses
Product: [Mono] Class Libraries Reporter: Dick Porter <dick>
Component: SystemAssignee: Bugzilla <bugzilla>
Severity: normal CC: masafa, miguel, mono-bugs+mono
Priority: ---    
Version: master   
Target Milestone: Untriaged   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Bug fix patch

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