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

Pekka Savola pekkas at netcore.fi
Tue Jul 5 02:46:30 EDT 2005


Hi,

On Tue, 5 Jul 2005, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote:
> In article <Pine.LNX.4.61.0507050833160.17376 at netcore.fi> (at Tue, 5 Jul 2005 08:35:04 +0300 (EEST)), Pekka Savola <pekkas at netcore.fi> says:
>
>> 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.
> :
>> Or does the kernel return EADDRINUSE, but still keep listening to
>> ipv6-allrouters (isn't this a bug?) ?
>
> Kernel still listen on that address.
> I think we should allow EADDRINUSE in this case.
> (Note: zebra does similarly.)

OK, I'd committed this with a couple of mods (removal of the other 
warning, added comment).  Attached.

This might warrant releasing radvd 0.7.4, so if folks have any pending 
changes or patches, now would be a good time to send them.

-- 
Pekka Savola                 "You each name yourselves king, yet the
Netcore Oy                    kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings
-------------- next part --------------
Index: CHANGES
===================================================================
RCS file: /work/cvsroot/radvd/CHANGES,v
retrieving revision 1.38
diff -u -r1.38 CHANGES
--- CHANGES	29 Mar 2005 12:59:41 -0000	1.38
+++ CHANGES	5 Jul 2005 06:43:27 -0000
@@ -1,5 +1,8 @@
 $Id: CHANGES,v 1.38 2005/03/29 12:59:41 psavola Exp $
 
+07/05/2005	Fix Linux-2.6.12-bk4+ error with HUP signal,
+		from YOSHIFUJI Hideaki / USAGI.
+
 03/29/2005	Merge a part of MIPv6/non-MIPv6 code, make printing
 		error messages nicer.
 
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 06:43:27 -0000
@@ -167,8 +167,12 @@
 
 	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);
+		/* linux-2.6.12-bk4 returns error with HUP signal but keep listening */
+		if (errno != EADDRINUSE)
+		{
+			flog(LOG_ERR, "can't join ipv6-allrouters on %s", iface->Name);
+			return (-1);
+		}
 	}
 
 	return (0);


More information about the radvd-devel-l mailing list