Re: [PATCH] ipv6 rework in udp_establish_listener
Pascal Terjan <[email protected]> Wed, 17 Aug 2005 18:56:15 +0200
| Newsgroups | gmane.comp.multimedia.xmms.devel |
|---|---|
| Organization | Mandriva |
| Message-ID | <[email protected]> |
Le mercredi 17 août 2005 à 15:31 +0200, Samuel Thibault a écrit :
> Pascal Terjan, le Wed 17 Aug 2005 14:36:37 +0200, a écrit :
> > (talking only for my patch, not the other ipv6 patches that I did not
> > yet really read but I think it uses getaddrinfo so will be more tricky
> > to have working...)
>
> No, it's _much_ easier to make working than using AF_INET6 & co by
> hand. getaddrinfo gives you every information you need: address family,
> protocol, address, ... You just need a HAVE_GETADDRINFO, and then you
> can use a loop like:
[...]
> if (getaddrinfo(NULL, listen_port, &hints, &res) != 0) {
And how do you write it when you want to create an udp socket on any
port, like this is done in http.c ?
gettaddrinfo wants one of hostname or port to be non NULL so I did not
use that and tried to create with AF_INET6 and if it fails, with
AF_INET...