[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenBSD 4.4 gnutls-serv IPv6 Only Bug

From: Simon Josefsson
Subject: Re: OpenBSD 4.4 gnutls-serv IPv6 Only Bug
Date: Fri, 24 Apr 2009 19:47:36 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.92 (gnu/linux)

Joe Orton <address@hidden> writes:

> On Fri, Apr 17, 2009 at 05:08:21PM +0200, Simon Josefsson wrote:
>> Peter Hendrickson <address@hidden> writes:
>> > Using GnuTLS 2.6.5 under OpenBSD 4.4, there is a bug in gnutls-serv.
>> > It only listens for connection on an IPv6 port and ignores all IPv4
>> > requests.  This can be seen by running something as simple as
>> > "gnutls-serv --http".  The patch below illustrates the problem and
>> > supplies a quick fix.
>> Hi.  Thanks for the report.  I'm not sure the patch is the right thing,
>> supporting only IPv4 seems like a step backwards.  Isn't there a way to
>> listen on all address families?
> Yes, but it's somewhat complicated, you have to create a socket for each 
> returned addrinfo structure, bind them all, set them non-blocking, and 
> then poll across them to wait for a connection, and cope with the edge 
> cases with v6-mapped IPv4 addresses which make it not that simple.

I tried to implement that:

Peter, can you test the latest daily snapshot?

There seems to be a cosmetic problem, though, on my normal debian

address@hidden:~/src/gnutls/src master$ ./gnutls-serv 
Set static Diffie Hellman parameters, consider --dhparams.
Echo Server listening to (family 2)...done
Echo Server listening to :::5556 (family 10)...bind() failed: Invalid argument
^CExiting via signal 2
address@hidden:~/src/gnutls/src master$ 

It seems bind fail on my IPv6 interface, which is probably right because
I haven't setup IPv6 here.  Is ignoring bind failures the right thing?
I'm not sure why getaddrinfo returns the IPv6 interface at all.

I'm not sure what you mean with v6-mapped IPv4 addresses, though.  Is
there anything extra the code needs to do?

Is there a syscall for printing a human readable address family name?  I
was hoping for getnameinfo, but no luck.  I'd like to print 'IPv4'
instead of 'family 2'..


reply via email to

[Prev in Thread] Current Thread [Next in Thread]