[packages] wide-dhcpv6: Set maintainer
[packages.git] / ipv6 / wide-dhcpv6 / patches / 001-linux_old_compat.patch
1 --- wide-dhcpv6-20080615.orig/common.h  2007-03-21 20:52:57.000000000 +1100
2 +++ wide-dhcpv6-20080615/common.h       2009-11-29 16:00:02.000000000 +1100
3 @@ -187,3 +187,34 @@
4  #ifndef HAVE_STRLCPY
5  extern size_t strlcpy __P((char *, const char *, size_t));
6  #endif
7 +
8 +/*
9 + * compat hacks in case libc and kernel get out of sync:
10 + *
11 + * glibc 2.4 and uClibc 0.9.29 introduce IPV6_RECVPKTINFO etc. and change IPV6_PKTINFO
12 + * This is only supported in Linux kernel >= 2.6.14
13 + *
14 + * This is only an approximation because the kernel version that libc was compiled against
15 + * could be older or newer than the one being run.  But this should not be a problem --
16 + * we just keep using the old kernel interface.
17 + *
18 + * these are placed here because they're needed in all of socket.c, recv.c and send.c
19 + */
20 +#ifdef __linux__
21 +#  if defined IPV6_RECVHOPLIMIT || defined IPV6_RECVPKTINFO
22 +#    include <linux/version.h>
23 +#    if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
24 +#      if defined IPV6_RECVHOPLIMIT && defined IPV6_2292HOPLIMIT
25 +#        undef IPV6_RECVHOPLIMIT
26 +#        define IPV6_RECVHOPLIMIT IPV6_2292HOPLIMIT
27 +#      endif
28 +#      if defined IPV6_RECVPKTINFO && defined IPV6_2292PKTINFO
29 +#        undef IPV6_RECVPKTINFO
30 +#        undef IPV6_PKTINFO
31 +#        define IPV6_RECVPKTINFO IPV6_2292PKTINFO
32 +#        define IPV6_PKTINFO IPV6_2292PKTINFO
33 +#      endif
34 +#    endif
35 +#  endif
36 +#endif
37 +