[Mono-dev] Bug in System.UriBuilder and System.Net.WebRequest and probably related classes (doesn't handle zone id)
Aaron Bockover
abockover at novell.com
Fri Mar 28 15:19:13 EDT 2008
I second this. We would greatly appreciate a fix as we are seeing issues
with DAAP support Banshee in some cases where two systems support IPv6,
including the mDNS layer. Sebastian helped me fix the IPv6 issue in
Mono.Zeroconf for Avahi and Bonjour, and now the problem is in these two
places in Mono.
--Aaron
On Sat, 2008-03-22 at 17:22 +0100, Sebastian Dröge wrote:
> Hi,
> it seems that System.UriBuilder and System.Net.WebRequest (and probably
> related classes) don't handle the zone id in URIs with IPv6 address
> correctly.
>
> See https://bugzilla.novell.com/show_bug.cgi?id=372840
>
> An example URI would be http://fe80::1234%1/blabla or even more
> confusing http://fe80::1234%1:80/blabla. See RFC4007 section 11.2.
>
>
> The problem with System.UriBuilder is now, that if one passes
> "fe80::1234%1" as host it will escape the % with %25 which will then be
> a completely invalid URL. It should instead keep the host part as is (is
> there any escaping for the host part required at all in any case?).
>
> The second issue is, that System.Net.WebRequest.Create() with such an
> URI simply won't work. When calling GetResponse() on it the following
> happens:
>
> System.Net.WebException: Error: ConnectFailure
> at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult)
> [0x00000]
> at System.Net.HttpWebRequest.GetResponse () [0x00000]
>
>
> System.Net.WebRequest (or whatever is responsible for this some level
> below) should instead parse the host part of the URI and put the zone id
> (if it's numeric, otherwise see below) into the sin6_scope_id field of
> struct sockaddr_in6 (at least that's how it would be done in C).
>
> System.Net.Sockets.Socket can set the ScopeId already.
>
> Now, if the zone id is _not_ numeric (it could be "eth0" on Linux for
> example) one has to ask the OS which interface id is corresponding to
> the zone id.
>
> As already this basic classes don't support it correctly I expect the
> same problem at different places too.
>
> It would be nice if this could be fixed for mono 2.0 already as it
> currently breaks banshee's DAAP sharing (the client side) when one has a
> link-local IPv6 address.
>
> Thanks
>
> PS: I'm not subscribed to the list so please CC me :)
>
> Novell Bug: https://bugzilla.novell.com/show_bug.cgi?id=372840
> Banshee bug: http://bugzilla.gnome.org/show_bug.cgi?id=523618
> RFC4007: http://tools.ietf.org/html/rfc4007
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list