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

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



On Wed, Feb 05, 2003 at 03:19:15PM +0900, Mitsuru KANDA / ?$B?@ED ?$B=< wrote:

> Have you try to use IPV6_V6ONLY option?

I'm not looking for a way to absolutely listen on two different
sockets for IPv4 and IPv6. Listening on both IPv4 and IPv6 with one
socket is quite acceptable. I was commenting that having the listen
fail when both binds succeeded maybe wasn't a good idea. I think it
would be more coherent to have either:

 - bind(ipv6) = SUCCESS
 - bind(ipv4) = FAILURE

or

 - bind(ipv6) = SUCCESS
 - bind(ipv4) = SUCCESS
 - listen(ipv6) = SUCCESS
 - listen(ipv4) = FAILURE

With the current USAGI, if a program does:

 - bind(ipv6)
 - bind(ipv4)

the program can't listen() on any of those sockets. This strikes me as
bizarre.

> At Fri, 31 Jan 2003 13:55:58 +0100,
> Lionel Elie Mamane wrote:

>> 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

FYI, the exim author has decided to use the scheme I described:

>> 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:

-- 
Lionel

Attachment: pgpCWklmrpWja.pgp
Description: PGP signature