Created attachment 321270 [details] /tmp/emerge--info dhp@uranus ~ $ curl -6 "http://[2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b]" curl: (3) [globbing] error: bad range specification after pos 9 dhp@uranus ~ $ curl -6 "http://[::1]" curl: (3) [globbing] illegal character in range specification at pos 9 dhp@uranus ~ $ emerge -vp curl These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] net-misc/curl-7.25.0-r1 USE="idn ipv6 ssh ssl threads -ares -kerberos -ldap -static-libs -test" CURL_SSL="openssl -axtls -gnutls -nss -polarssl" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB * IMPORTANT: 4 news items need reading for repository 'gentoo'. * Use eselect news to read news items. dhp@uranus ~ $
Wouldn't it just work without the square brackets? jer@wieneke $ curl -6 "http://[2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b]" curl: (3) [globbing] error: bad range specification after pos 9 jer@wieneke $ curl -6 "http://2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b" curl: (7) Failed to connect to 2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b: Network is unreachable At least in the second case, curl recognises the URL.
"http://[2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b]" is what works in lynx and firefox. When using your second line, I don't get the right content.
From the manpage: -g, --globoff This option switches off the "URL globbing parser". When you set this option, you can specify URLs that contain the letters {}[] without having them being interpreted by curl itself. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard. Solution: Use -g Hope this helps.
dhp@uranus ~ $ curl -g "http://fe80::201:3ff:fe0c:3d5b%eth0" <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>400 - Bad Request</title> </head> <body> <h1>400 - Bad Request</h1> </body> </html> dhp@uranus ~ $ curl -g 'http://fe80::201:3ff:fe0c:3d5b%eth0' <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>400 - Bad Request</title> </head> <body> <h1>400 - Bad Request</h1> </body> </html> dhp@uranus ~ $ curl -g 'http://[fe80::201:3ff:fe0c:3d5b%eth0]' curl: (6) Could not resolve host: [fe80::201:3ff:fe0c:3d5b%eth0]; Name or service not known dhp@uranus ~ $ curl -g 'http://[fe80::201:3ff:fe0c:3d5b%250]' curl: (7) Failed to connect to fe80::201:3ff:fe0c:3d5b: Invalid argument dhp@uranus ~ $ curl -g 'http://[fe80::201:3ff:fe0c:3d5b%251]' curl: (7) Failed to connect to fe80::201:3ff:fe0c:3d5b: Network is unreachable dhp@uranus ~ $ curl -g 'http://[fe80::201:3ff:fe0c:3d5b%252]' curl: (7) Failed to connect to fe80::201:3ff:fe0c:3d5b: Network is unreachable dhp@uranus ~ $ Works for me with 'http://[fe80::201:3ff:fe0c:3d5b%256]' 'http://[fe80::201:3ff:fe0c:3d5b%eth0]' works with firefox just fine, but gives an error with curl. 'http://fe80::201:3ff:fe0c:3d5b%eth0' gives an HTML content, but not the good one, and ... I even wonder if this content is really generated by the server I think about. Even with -g, curl does not accept conventional syntax, and seems to use a syntax similar to the one used in Windows (by NIC #), whereas on Gentoo, I was expecting curl to accept the BSD syntax (%ifname). If ever you would close this bug with "WORKSFORME" or "CANTFIX", please update the manpage, to explain that curl uses a counter intuitive syntax. What is counter intuitive should for the least be documented. But the best fix would be to make curl accept conventional BSD syntax ...