[PATCH] remove zone identifier for IPv6 link-local addresses

Denys Vlasenko vda.linux at googlemail.com
Tue Jun 30 17:48:35 UTC 2009


On Tue, Jun 30, 2009 at 6:11 PM, Fabian
Hugelshofer<hugelshofer2006 at gmx.ch> wrote:
> I think this "if (scope > cp)" could be removed. There should be no '%'
> after the ']' as it seems that %-encoding in the host/port-part of an
> URL isn't supported anyway.
>
>> I propose the following attached patch. It is against newer git.
>
> Dva changed the way I called the strip function and missed out a small
> detail. From dva's patch:
>
> if (use_proxy) {
>        proxy = getenv(target.is_ftp ? "ftp_proxy" : "http_proxy");
>        if (proxy && proxy[0]) {
>                parse_url(proxy, &server);
>        } else {
>                use_proxy = 0;
>        }
> } else {
>        server.port = target.port;
>        if (ENABLE_FEATURE_IPV6) {
>                server.host = xstrdup(target.host);
>        } else {
>                server.host = target.host;
>        }
> }
>
> This is wrong, as use_proxy (that is true by default) can get set to
> false within the condition. In this case the server parameters would not
> be set at all. The server assignment stuff needs a separate condition.
> See the version in the attached patch.
>
>
>> Please test, and let the list know what commands do you test,
>> do you use $http_proxy variable etc... Like:
>>
>> wget http://::1&lo/path
>> wget http://[::1&lo]:80/path
>> ...
>
> I tested the patch with the fixed proxy condition with http_proxy unset.
> I successfully tested the following commands:
>
> wget http://[::1]/path
> wget http://::1/path
> wget http://[fe80::1%eth0]/path
> wget http://[fe80::1%eth0]:80/path
> wget http://fe80::1%eth0/path
>
>
>> Code impact is a bit big:
>>
>> # make bloatcheck
>> function                                             old     new   delta
>> wget_main                                           2331    2433    +102
>
> IMHO it would be possible to remove support for addresses without
> [enclosure] in the strip function. According to RFC3986
> (http://tools.ietf.org/html/rfc3986#section-3.2.2) IPv6 addresses need
> to be enclosed in URIs. str2sockaddr() only supports both versions as it
> is not exclusively called with addresses from URIs.
>
> Attached you find a 9.patch that fixes the use_proxy condition and a
> 10.patch that further removes the parts mentioned above.


Applied, thanks!
--
vda


More information about the busybox mailing list