[radvd-devel-l] radvd on freetz (Fritzbox mod) - radvd[1865]: setsockopt(IPV6_RECVPKTINFO): Protocol not available

Paul Oranje p.oranje at xs4all.nl
Thu Jan 15 17:45:11 EST 2009


The following patch has solved the problem on the Fritzbox 7170 with  
kernel 2.6.13 and uclibc 0.9.29:

<patch>
--- recv.c.orig	2006-10-09 08:21:59.000000000 +0200
+++ recv.c	2009-01-13 19:39:03.000000000 +0100
@@ -18,6 +18,14 @@
  #include <includes.h>
  #include <radvd.h>

+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) &&  
(defined(__UCLIBC__) && __UCLIBC_MAJOR__ == 0 && __UCLIBC_MINOR__ == 9  
&& __UCLIBC_SUBLEVEL__ >= 29)
+# undef IPV6_HOPLIMIT
+# undef IPV6_PKTINFO
+# define IPV6_HOPLIMIT IPV6_2292HOPLIMIT
+# define IPV6_PKTINFO IPV6_2292PKTINFO
+#endif
+
  int
  recv_rs_ra(int sock, unsigned char *msg, struct sockaddr_in6 *addr,
                   struct in6_pktinfo **pkt_info, int *hoplimit)
--- send.c.orig	2008-10-15 07:34:35.000000000 +0200
+++ send.c	2009-01-13 19:40:05.000000000 +0100
@@ -18,6 +18,12 @@
  #include <includes.h>
  #include <radvd.h>

+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) &&  
(defined(__UCLIBC__) && __UCLIBC_MAJOR__ == 0 && __UCLIBC_MINOR__ == 9  
&& __UCLIBC_SUBLEVEL__ >= 29)
+# undef IPV6_PKTINFO
+# define IPV6_PKTINFO IPV6_2292PKTINFO
+#endif
+
  void
  send_ra(int sock, struct Interface *iface, struct in6_addr *dest)
  {
--- socket.c.orig	2005-10-18 21:22:00.000000000 +0200
+++ socket.c	2009-01-13 19:37:03.000000000 +0100
@@ -18,6 +18,13 @@
  #include <includes.h>
  #include <radvd.h>

+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) &&  
(defined(__UCLIBC__) && __UCLIBC_MAJOR__ == 0 && __UCLIBC_MINOR__ == 9  
&& __UCLIBC_SUBLEVEL__ >= 29)
+# undef IPV6_RECVHOPLIMIT
+# undef IPV6_RECVPKTINFO
+# define IPV6_RECVHOPLIMIT IPV6_2292HOPLIMIT
+# define IPV6_RECVPKTINFO IPV6_2292PKTINFO
+#else
  /* Note: these are applicable to receiving sockopts only */
  #if defined IPV6_HOPLIMIT && !defined IPV6_RECVHOPLIMIT
  # define IPV6_RECVHOPLIMIT IPV6_HOPLIMIT
@@ -26,6 +33,7 @@
  #if defined IPV6_PKTINFO && !defined IPV6_RECVPKTINFO
  # define IPV6_RECVPKTINFO IPV6_PKTINFO
  #endif
+#endif

  int
  open_icmpv6_socket(void)
</patch>

-- 
Paul Oranje
M	+31 (6) 21278389
T	+31 (20) 4941306
Achterlaan 20, 1027 AK Zunderdorp




Op 13 jan 2009, om 10:13 heeft Pekka Savola het volgende geschreven:

> On Tue, 13 Jan 2009, Paul Oranje wrote:
>> <patch>
>> -/* Note: these are applicable to receiving sockopts only */
>> -#if defined IPV6_HOPLIMIT && !defined IPV6_RECVHOPLIMIT
>> +#include <linux/version.h>
>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
>> +# undef IPV6_RECVHOPLIMIT
>> +# undef IPV6_RECVPKTINFO
>> +# define IPV6_HOPLIMIT 8
>> +# define IPV6_PKTINFO  2
>> # define IPV6_RECVHOPLIMIT IPV6_HOPLIMIT
>> -#endif
>> -
>> -#if defined IPV6_PKTINFO && !defined IPV6_RECVPKTINFO
>> # define IPV6_RECVPKTINFO IPV6_PKTINFO
>> #endif
>> </patch>
>
> This IPV6_RECVPKTINFO is not the same thing as IPV6_PKTINFO and  
> likewise for IPV6_RECVHOPLIMIT.  So it's not a surprise this does  
> not work.
>
> The following decimal values are correct (from Centos 5 system):
>
> /usr/include/linux/in6.h:#define IPV6_RECVPKTINFO       49
> /usr/include/linux/in6.h:#define IPV6_RECVHOPLIMIT      51
>
> The working strace shows these as follows:
>
> setsockopt(3, SOL_IPV6, 0x31 /* IPV6_??? */, [1], 4) = 0
> setsockopt(3, SOL_IPV6, 0x33 /* IPV6_??? */, [1], 4) = 0
>
> So the problem is clearly that either the kernel or uclibc doesn't  
> support IPV6_RECVPKTINFO and/or IPV6_RECVHOPLIMIT or there is some  
> problem with them.  There isn't much I as a radvd maintainer can do  
> about that.  I think the issue investigation needs to be continued  
> in the trac you referenced.
>
> -- 
> 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