[radvd-devel-l] [PATCH] Ignore EADDRINUSE when rejoining all-routers multicast address

Pekka Savola pekkas at netcore.fi
Tue Jul 5 01:35:04 EDT 2005


On Tue, 5 Jul 2005, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote:
> linux-2.6.12-bk4 or later return error w/ errno == EADDRINUSE.
> Let's ignore it, or radvd dies when received HUP signal.

The patch looks good, but doesn't this imply that the HUPped radvd no 
longer listens to ipv6-allrouters, thus crippling radvd?

Or does the kernel return EADDRINUSE, but still keep listening to 
ipv6-allrouters (isn't this a bug?) ?


> Index: device-linux.c
> ===================================================================
> RCS file: /work/cvsroot/radvd/device-linux.c,v
> retrieving revision 1.12
> diff -u -r1.12 device-linux.c
> --- device-linux.c	7 Jan 2005 19:16:52 -0000	1.12
> +++ device-linux.c	5 Jul 2005 05:19:43 -0000
> @@ -167,8 +167,15 @@
>
> 	if (setsockopt(sock, SOL_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
> 	{
> -		flog(LOG_ERR, "can't join ipv6-allrouters on %s", iface->Name);
> -		return (-1);
> +		if (errno != EADDRINUSE)
> +		{
> +			flog(LOG_ERR, "can't join ipv6-allrouters on %s", iface->Name);
> +			return (-1);
> +		}
> +		else {
> +			flog(LOG_WARNING, "can't join ipv6-allrouters on %s (ignored)", iface->Name);
> +			return (0);
> +		}
> 	}
>
> 	return (0);
>
>

-- 
Pekka Savola                 "You each name yourselves king, yet the
Netcore Oy                    kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings


More information about the radvd-devel-l mailing list