gnutls-devel
[Top][All Lists]
Advanced

[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, 17 Apr 2009 17:08:21 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.90 (gnu/linux)

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?

> (BTW, I have just started looking at GnuTLS and I really like it!)

Great!

/Simon

>
> Peter
>
> --- serv.c.orig       Sat Apr 11 18:35:29 2009
> +++ serv.c    Fri Apr 17 06:00:11 2009
> @@ -652,6 +652,12 @@
>  
>    snprintf (portname, sizeof (portname), "%d", listen_port);
>    memset (&hints, 0, sizeof (hints));
> +  /* Under OpenBSD 4.4, getaddrinfo() returns an IPv6 addrinfo
> +     structure followed by an IPv4 addrinfo structure.  The code below
> +     uses the first successful structure it gets which means it
> +     listens for IPv6 connections.  Setting the family hint to AF_INET
> +     forces getaddrinfo() to return IPv4 addrinfo structures. */
> +  hints.ai_family = AF_INET;
>    hints.ai_socktype = SOCK_STREAM;
>    hints.ai_flags = AI_PASSIVE;




reply via email to

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