Re: [Exim] [BUG?] 3.32: IPv6 changes cause Exim to not start

Pàgina inicial
Delete this message
Reply to this message
Autor: Phil Brutsche
Data:  
A: Kevin Sindhu
CC: exim-users
Assumpte: Re: [Exim] [BUG?] 3.32: IPv6 changes cause Exim to not start
On 09 Aug 2001 17:34:24 -0700, Kevin Sindhu wrote:
> Ah. So it only happens if:
>
> 1) Exim 3.32 is compiled with IPv6 support
> 2) OS does not support IPv6.
>
> Cool!;-).


yep :)

> So how do we want to catch this exception?


Lessee... Ready for some C programming?

daemon.c has the following code starting at line 739, and the source of
this entire thread:

    listen_sockets[sk] = socket(af, SOCK_STREAM, 0);
    if (listen_sockets[sk] < 0)
      log_write(0, LOG_PANIC_DIE, "IPv%c socket creation failed: %s",
        (af == AF_INET6)? '6' : '4', strerror(errno));


Ok, I don't see any easy way out of it. 5 lines up sk is incremented in
a for (...) loop...

With a linked list it would go something like

    temp_socket = socket (...);
    if (temp_socket >= 0)
      add the socket to the linked list
    else
      try the next interface
    continue processing


Once we're done done with the "main loop" we can copy the linked list
into the listen_sockets array and adjust the counter counting the number
of sockets accordingly.

But how will the rest of Exim react when the number of sockets is less
than the number of detected interfaces? Will it care? Will it cause
the end of the universe as we know it? I think we'll need Phil Hazel to
answer those questions...

> Suggestions:
>
>     1) Painc and tell the user not to use IPv6 on a non-Ipv6 speaking
>     OS. I am thinking "Error: What? Can't you see I need IPv6 capable
>     machine to run IPv6? No bread for you!!" [Or basically give a
>     better error on what its giving now].


This is what's done now, only not so verbosely.

>     2) Give a warning and continue to work on the IPv4 sockets.


This is what I would prefer.

--

Phil