[radvd-devel-l] 6to4 fix for big-endian arches

Pekka Savola pekkas at netcore.fi
Tue Jul 5 03:09:32 EDT 2005


FYI,

I've committed the attached patch, from Debian by Sam Hathaway.  It 
fixes 6to4 prefix calculation on big endian arches.  I wonder why this 
wasn't noticed before...

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=301543

-- 
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.39
diff -u -r1.39 CHANGES
--- CHANGES	5 Jul 2005 06:44:17 -0000	1.39
+++ CHANGES	5 Jul 2005 07:06:13 -0000
@@ -1,5 +1,9 @@
 $Id: CHANGES,v 1.39 2005/07/05 06:44:17 psavola Exp $
 
+07/05/2005	Fix wrongly calculated prefix with Base6to4Interface
+                on ppc and maybe other big endian arches, from
+		Debian #301543 by Sam Hathaway.
+
 07/05/2005	Fix Linux-2.6.12-bk4+ error with HUP signal,
 		from YOSHIFUJI Hideaki / USAGI.
 
Index: gram.y
===================================================================
RCS file: /work/cvsroot/radvd/gram.y,v
retrieving revision 1.10
diff -u -r1.10 gram.y
--- gram.y	22 Mar 2005 10:29:13 -0000	1.10
+++ gram.y	5 Jul 2005 07:06:13 -0000
@@ -340,7 +340,7 @@
 					prefix->enabled = 0;
 				} else
 				{
-					*((uint32_t *)(prefix->Prefix.s6_addr)) = htons(0x2002);
+					*((uint16_t *)(prefix->Prefix.s6_addr)) = htons(0x2002);
 					memcpy( prefix->Prefix.s6_addr + 2, &dst, sizeof( dst ) );
 				}
 			}


More information about the radvd-devel-l mailing list