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

(usagi-users 02176) Re: Bug?: bind(6);bind(4);listen(6) used to work



Have you try to use IPV6_V6ONLY option?

on=1;
setsockopt(fd6, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));

-mk

At Fri, 31 Jan 2003 13:55:58 +0100,
Lionel Elie Mamane wrote:
> 
> Hi,
> 
> This (pseudo-) code works with vanilla Linux, and other platforms:
> 
>  - bind(IPv6 any address, port foo)
>  - bind(IPv4 any address, port foo)
>  - listen(IPv6 any address, port  foo)
>  - listen(IPv4 any address, port foo)
>          ignore failure if errno=EADDRINUSE: the IPv6 socket listens
> 	 for IPv4 connections
> 
> In particular, that's what the exim MTA does by default (if no
> explicit bind/listen instruction given in config file)
> 
> But with USAGI patch, the first listen fails, with errno=EADDRINUSE,
> while _there_ is no one listening!
> Looks like you expect programs to do:
> 
>  - bind(IPv6 any address)
>  - listen(IPv6 any address)
>  - bind(IPv4 any address), failure because EADDRINUSE -> goto end
>  - listen(IPv4 any address)
>  - :end:
> 
> Anyway, failing at the first listen is IMHO a bad idea: Either fail at
> the _second_ listen like vanilla Linux, or fail at the second bind.
> 
> So, where's the problem? Should exim change its way or is this an
> USAGI glitch? It looks like the first case works for all other
> platforms supported by exim!
> 
> If you think exim should change its way, could you please give me
> arguments (RFC references, POSIX or Single Unix Specification
> reference, ...) to convince the exim authors?