Re: wget and ipv6 (1.6 beta5) serious bugs

2003-10-15 Thread Arkadiusz Miskiewicz
On Wednesday 15 of October 2003 12:11, Thomas Lussnig wrote:

 Ok this is clear, but than why become the aplication an binary IPv6
 enabled one
 if the PC have no IPv6 support ?
Because I'm using packages provided by Linux distribution which needs ipv6 
because some users are using it.

 I thought the configure script checked
 if the pc
 have IPv6 support. and yes both of the sugested workarounds would do it.
Checking at configure time if host on which I'm compiling does support 
socket(AF_INET6, ...) is stupid. It should only check if it's able to use 
getaddrinfo(), genameinfo() and so on while the code should be written in 
family independent way.

I always can compile on one host and use it on a other. Also in future there 
will be way to unload ipv6 module from Linux kernel. What then?

 But there are two problems with them.

 1. If you try to create an IPv6 socket only to check the IPv6 support i
 think this is
 like try and error that is not one of the best choice.
Yes, best choice is to write app in family independent way.

 2. DNS can support IPv6 even if the OS is not IPv6 aware. So the use of
 the DNS
 and try thorugh is also try and error, wich is acceptable since it is
 defined that you
 can try the next Adress if one does not work. But it does not check the
 return value.
What I wrote was pseudo code not real code - only to show the idea. Of course 
errors should be checked and if error  res-ai_next != NULL then try 
ai_next.

 So it retry each time if one version work or not.
There is also AI_ADDRCONFIG option which causes that getaddrinfo() returns 
only these families which are supported by the system.

 3. The major problem is that on such IPv4 only system. Even the parser
 should complain
 about an unsupported Adress in the url if there an IPv6 is specified.
No. On such system connection to ipv6 host is not possible and that is what 
should be in error message. ,,Familly not supported'' and try ai-next then.

The keyword for ipv6 things is ,,family independent'' rather than ,,ipv6 
ready''.

 Cu Thomas

-- 
Arkadiusz MikiewiczCS at FoE, Wroclaw University of Technology
arekm.pld-linux.org AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux



wget and ipv6 (1.6 beta5) serious bugs

2003-10-14 Thread Arkadiusz Miskiewicz
Hi,

Right now wget code looks like this:

#ifdef ENABLE_IPV6
int ip_default_family = AF_INET6;
#else
int ip_default_family = AF_INET;
#endif

and then
./connect.c:  sock = socket (ip_default_family, SOCK_STREAM, 0);


This assumes that binary compiled with ipv6 support is always used on IPv6 
capable host which is not true in many, many cases. Such binary on ipv4 only 
host will cause:

[EMAIL PROTECTED] src]$ LC_ALL=C ./wget wp.pl
--21:48:37--  http://wp.pl/
   = `index.html'
Resolving wp.pl... 212.77.100.101
Connecting to wp.pl[212.77.100.101]:80... failed: Address family not supported 
by protocol.
Retrying.

--21:48:38--  http://wp.pl/
  (try: 2) = `index.html'
Connecting to wp.pl[212.77.100.101]:80... failed: Address family not supported 
by protocol.
Retrying.

--21:48:40--  http://wp.pl/
  (try: 3) = `index.html'
Connecting to wp.pl[212.77.100.101]:80... failed: Address family not supported 
by protocol.
Retrying.


Applications that use getaddrinfo() shouldn't even bother to know which family 
they use. Just should do

getaddrinfo(host, ..., res0);
for (res = res0; res; res=res-ai_next) {
  s = socket(res-ai_family, res-ai_socktype, res-ai_protocol)
  if (s0)
continue
  if ((connect(s, res-ai_addr, res-ai_addrlen) 0 ) {
 close(s)
 continue)
  }
  break
}

This pseudo-code should show the idea. 


The best thing IMO is to use getaddrinfo for resolving + struct addrinfo 
(linked list) for storing data about host.x.y.com. For systems without 
getaddrinfo ipv4 only replacements should be provided - see openssh portable 
how it's done there.

The whole idea of getaddrinfo/getnameinfo is to get family independent 
functions. They even work for AF_UNIX on some systems (like on linux+glibc).

Anyway for now workaround is something like this in main():

#ifdef ENABLE_IPV6
s = socket(AF_INET6, SOCK_STREAM, 0);
if (s  0  (errno == EAFNOSUPPORT))
   ip_default_family = AF_INET;
close(s);
#endif

-- 
Arkadiusz MikiewiczCS at FoE, Wroclaw University of Technology
arekm.pld-linux.org AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux



Re: some wget patches against beta3

2003-10-12 Thread Arkadiusz Miskiewicz
On Tuesday 07 of October 2003 12:08, Hrvoje Niksic wrote:
 Thanks!

btw. looking into test4 I see that autoconf conception is used in weird way. 
Normally aclocal.m4 is autogenerated by aclocal command (and it includes 
sources of macros from /usr/share/autoconf/autoconf/*.m4 and from local 
acinclude.m4).

You are seem to put all macros (even local macros!) inside of aclocal.m4. This 
is bad because it doesn't allow to regenerate autoconf/aclocal stuff in case 
when it's needed. aclocal command will overwrite aclocal.m4 and all local 
macros will be lost.

We at PLD are right now patching wget to move all local macros into 
acinclude.m4 but it would be better if that was done properly at wget 
maintainers level :)

ps. I see that beta5 is there so time to look into this one... argh, same 
things as in test4
-- 
Arkadiusz MikiewiczCS at FoE, Wroclaw University of Technology
arekm.pld-linux.org AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux



some wget patches against beta3

2003-10-03 Thread Arkadiusz Miskiewicz
Hi,

Here is few patches against test3:

http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/wget-ac.patch?rev=1.4
(some autoconf 2.5x things)

http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/wget-pl.patch?rev=1.3
(Polish translation update)

-- 
Arkadiusz MikiewiczCS at FoE, Wroclaw University of Technology
arekm.pld-linux.org AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux



Re: Please upgrade libtool in wget

2001-06-05 Thread Arkadiusz Miskiewicz

Hrvoje Niksic [EMAIL PROTECTED] writes:

  and please fix aclocal.m4 (it contains wget specific macros which
  should be in acinclude.m4)
 
 I'm not buying that.  I think it's perfectly fine to have
 Wget-specific macros in aclocal.m4.
Why you are trying to make things more difficult than they really are?
Now I can't use new libtool.m4 (and other m4 macros) for wget without
patching it. aclocal.m4 should be autogenerated to make life yeasier.

  and also acconfig.h is missing (autoheader breaks on it).
 Don't use autoheader.
The same here. If I want to add some patch to wget (ie ipv6 support) I
need to fix it autoconfigure support... 

-- 
Arkadiusz Mikiewicz, AM2-6BONE, 1024/3DB19BBD
 http://www.t17.ds.pwr.wroc.pl/~misiek/ipv6/
IPv6 ready PLD/Linux at http://www.pld.org.pl/



Re: Please upgrade libtool in wget

2001-06-05 Thread Arkadiusz Miskiewicz

Hrvoje Niksic [EMAIL PROTECTED] writes:

 Daniel Stenberg [EMAIL PROTECTED] writes:
 
  % aclocal --version
  aclocal (GNU automake) 1.4-p2
 
 That must explain it -- I've never used Automake.
Usually generic system macros are placed in /usr/share/aclocal
directory (and for example there is libtool.m4 from my libtool) and
when you call aclocal macros used in configre.in are searched in
/usr/share/aclocal and in acinclude.m4, acsite.m4... Now if you
provide some wget specific macros you should place them in
acinclude.m4 since aclocal.m4 is overwritten at aclocal call.

The same thing with autoheader. When you change configre.in (for
example add AC_CHECK_FUNCS(xyz) then autoheader call will place proper
#undef HAVE_XYZ in config.h.in... But if you use some local
definitions you must place #undef LOCAL_SOMETHING in accinclude.h to
get it properly placed in config.h.in at autoheader call...

-- 
Arkadiusz Mikiewicz, AM2-6BONE, 1024/3DB19BBD
 http://www.t17.ds.pwr.wroc.pl/~misiek/ipv6/
IPv6 ready PLD/Linux at http://www.pld.org.pl/



Re: Please upgrade libtool in wget

2001-06-04 Thread Arkadiusz Miskiewicz

Adrian Bunk [EMAIL PROTECTED] writes:

 wget-1.7 ships with libtool 1.3.5. libtool  1.4 causes grave
 miscompilatios under NetBSD/sparc-1.5. Please upgrade libtool in
 wget.
and please fix aclocal.m4 (it contains wget specific macros which
should be in acinclude.m4) and also acconfig.h is missing (autoheader
breaks on it).

 Adrian

ps. updated Polish translation:
 http://cvs.pld.org.pl/i18n/po.pl/wget.pl.po?rev=1.2  
(always available here)
-- 
Arkadiusz Mikiewicz, AM2-6BONE, 1024/3DB19BBD
 http://www.t17.ds.pwr.wroc.pl/~misiek/ipv6/
IPv6 ready PLD/Linux at http://www.pld.org.pl/



Re: Polish translation for wget 1.6

2001-01-31 Thread Arkadiusz Miskiewicz

 Hello,
 I updated Polish translation for wget 1.6. I noticed, that previous file had
 all polish characters changed to '?'. I don't know the reason of that. Maybe
 because of some conversion of gettext. Anyway, please put this new file in Your
 distribution.
It's already fixed in CVS.

 Grzegorz Kowal [[EMAIL PROTECTED]]

-- 
Arkadiusz Mikiewicz, AM2-6BONE[ PLD GNU/Linux IPv6 ]
http://www.t17.ds.pwr.wroc.pl/~misiek/ipv6/   [ enabled ]