Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

RE: [milter-greylist] MX synchronization loss critical bug

2009-05-15 by attila.bruncsak@itu.int

> I suspect you got the message in question even before you tried to fix
> the problem, and you get "cannot set IPV6_V6ONLY:" message as well,
> right? 

Yes, I got it once.

> If so, your system uses IPv4-mapped IPv6 address and we cannot disable
> use of it.  In that case, your system listen IPv4 by IPv6 socket.  So,
> you don't need to listen on IPv4 separately.
> 
> attila> Probably with SO_REUSEPORT that message would go away.
> 
> If is is your case, the error is expected behavior, and use of
> SO_REUSEPORT is not good way, IMHO.  Just disabling the message is
> enough.
> 
> Index: sync.c
> diff -u -p sync.c.orig sync.c
> --- sync.c.orig	2009-05-15 16:55:20.000000000 +0900
> +++ sync.c	2009-05-15 18:42:14.249372861 +0900
> @@ -961,15 +961,19 @@ sync_listen(addr, port, sms)
>  		optval = 1;
>  		if ((setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
>  		    &optval, sizeof(optval))) != 0) {
> +#if 0
>  			mg_log(LOG_ERR, "cannot set IPV6_V6ONLY: %s",
>  			    strerror(errno));
> +#endif
>  		}
>  	}
>  #endif
>  
>  	if (bind(s, SA(&laddr), laddrlen) != 0) {
> +#if 0
>  		mg_log(LOG_ERR, "cannot start MX sync, bind failed: %s",
>  		    strerror(errno));
> +#endif
>  		sms->runs = 0;
>  		close(s);
>  		return;

I still feel it is an overhead to try
to open a new socket for every new recipient,
even if there is no error message about the
bind failure because we hide it.

What about the following:
When we once get the message
"cannot set IPV6_V6ONLY"
consider it as serious
(actually no real support for IPv6 in the kernel)
so close the socket do not start
the IPv6 sync_master thread
but set the sync_master6.runs equals to -1
without associated thread running.
The mg will not try to start it again later.

That way the IPv4 thread sync_master thread will start
happily no need the SO_REUSEPORT.

Please see the attached patch for an implementation.
Also based on the vanilla 4.3.2.

Bests,
Attila

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.