diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-09-05 13:28:20 +0100 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-09-05 13:28:20 +0100 |
commit | 2d480d4acf9bb0881a192f8ad181ca736fd0f4b2 (patch) | |
tree | 750e53d8447bb253c90b67687e0999f159e6ed36 /lib/sockopt.c | |
parent | 1bc859b342e415a4c7de2956a6b5fd732923d9da (diff) | |
download | quagga-2d480d4acf9bb0881a192f8ad181ca736fd0f4b2.tar.bz2 quagga-2d480d4acf9bb0881a192f8ad181ca736fd0f4b2.tar.xz |
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.
Diffstat (limited to 'lib/sockopt.c')
-rw-r--r-- | lib/sockopt.c | 20 |
1 files changed, 15 insertions, 5 deletions
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 <linux/in6.h> +# if defined(GNU_LINUX) && !defined(NO_LINUX_IN6_H) + #include <linux/in6.h> +# endif # endif enum |