[package] re-enable ipv6 in apr (#5608)
[openwrt/svn-archive/archive.git] / ipv6 / radvd / patches / 003-linux_old_compat.patch
1 --- radvd-1.2/radvd.h 2008-01-24 12:10:18.000000000 +0200
2 +++ radvd-1.2.mod/radvd.h 2009-01-17 22:10:52.000000000 +0200
3 @@ -235,4 +235,34 @@
4 int privsep_interface_reachtime(const char *iface, uint32_t rtime);
5 int privsep_interface_retranstimer(const char *iface, uint32_t rettimer);
6
7 +/*
8 + * compat hacks in case libc and kernel get out of sync:
9 + *
10 + * glibc 2.4 and uClibc 0.9.29 introduce IPV6_RECVPKTINFO etc. and change IPV6_PKTINFO
11 + * This is only supported in Linux kernel >= 2.6.14
12 + *
13 + * This is only an approximation because the kernel version that libc was compiled against
14 + * could be older or newer than the one being run. But this should not be a problem --
15 + * we just keep using the old kernel interface.
16 + *
17 + * these are placed here because they're needed in all of socket.c, recv.c and send.c
18 + */
19 +#ifdef __linux__
20 +# if defined IPV6_RECVHOPLIMIT || defined IPV6_RECVPKTINFO
21 +# include <linux/version.h>
22 +# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
23 +# if defined IPV6_RECVHOPLIMIT && defined IPV6_2292HOPLIMIT
24 +# undef IPV6_RECVHOPLIMIT
25 +# define IPV6_RECVHOPLIMIT IPV6_2292HOPLIMIT
26 +# endif
27 +# if defined IPV6_RECVPKTINFO && defined IPV6_2292PKTINFO
28 +# undef IPV6_RECVPKTINFO
29 +# undef IPV6_PKTINFO
30 +# define IPV6_RECVPKTINFO IPV6_2292PKTINFO
31 +# define IPV6_PKTINFO IPV6_2292PKTINFO
32 +# endif
33 +# endif
34 +# endif
35 +#endif
36 +
37 #endif