From 2d480d4acf9bb0881a192f8ad181ca736fd0f4b2 Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Mon, 5 Sep 2011 13:28:20 +0100 Subject: Work around issues with IPV6_MINHOPCOUNT -- -DNO_LINUX_IN6_H On GNU_LINUX IPV6_MINHOPCOUNT is defined in linux/in6.h. Unfortunately, that will not always compile due to clashes with netinet/in.h !! So, as a work-around -DNO_LINUX_IN6_H disables the inclusion of linux/in6.h -- which avoids the compilation issue, but turns off IPV6_MINHOPCOUNT. --- lib/sockopt.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'lib/sockopt.c') diff --git a/lib/sockopt.c b/lib/sockopt.c index c7a8db5f..b1e47c99 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -275,12 +275,22 @@ setsockopt_minttl (int sock_fd, int ttl) #ifdef HAVE_IPV6 -# ifdef GNU_LINUX - /* The #include to bring in IPV6_MINHOPCOUNT is buried more or less as - * deep as we can get it, because it also redefines a number of things - * that we do not want redefined. +# ifndef IPV6_MINHOPCOUNT + /* IPV6_MINHOPCOUNT ought to find its way into in.h at some point. + * + * For GNU_LINUX it is currently found in linux/in6.h. Unfortunately, that + * seems to redefine a number of things which are defined in in.h... so, + * the #include to bring in IPV6_MINHOPCOUNT is buried more or less as + * deep as we can get it. + * + * However, this trick does not always work... for example, if linux/in6.h + * redefines "extern const struct in6_addr in6addr_any" !! Do not know + * any way to fix that, so -DNO_LINUX_IN6_H will turn this off -- and will + * have to live without IPV6_MINHOPCOUNT pro tem. */ - #include +# if defined(GNU_LINUX) && !defined(NO_LINUX_IN6_H) + #include +# endif # endif enum -- cgit v1.2.3