The #define IPV6_MINHOPCNT define is never defined on any unix platform.
>From what I can tell the original implementation on the linux platform
was IPV6_MINHOPCNT, when it got accepted into the mainstream kernel
it was transformed into IPV6_MINHOPCOUNT. Since we test for the
define before attempting to use the code it was silently doing nothing
for a long time.
---
configure.ac | 5 ++++-
lib/sockunion.c | 10 +++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index a82470c..d680c5d 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1074,7 +1074,7 @@ dnl ------------------
dnl IPv6 header checks
dnl ------------------
AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
- netinet6/in6_var.h netinet6/nd6.h], [], [],
+ netinet6/in6_var.h netinet6/nd6.h linux/in6.h], [], [],
QUAGGA_INCLUDES)
m4_define([QUAGGA_INCLUDES],dnl
@@ -1094,6 +1094,9 @@ QUAGGA_INCLUDES
#if HAVE_NETINET6_ND6_H
# include <netinet6/nd6.h>
#endif
+#if HAVE_LINUX_IN6_H
+# include <linux/in6.h>
+#endif
])dnl
dnl disable doc check
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 5e6cf68..d9a61e4 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -28,6 +28,10 @@
#include "str.h"
#include "log.h"
+#if defined(HAVE_LINUX_IN6_H)
+#include <linux/in6.h>
+#endif
+
#ifndef HAVE_INET_ATON
int
inet_aton (const char *cp, struct in_addr *inaddr)
@@ -505,13 +509,13 @@ sockopt_minttl (int family, int sock, int minttl)
return ret;
}
#endif /* IP_MINTTL */
-#ifdef IPV6_MINHOPCNT
+#ifdef IPV6_MINHOPCOUNT
if (family == AF_INET6)
{
- int ret = setsockopt (sock, IPPROTO_IPV6, IPV6_MINHOPCNT, &minttl,
sizeof(minttl));
+ int ret = setsockopt (sock, IPPROTO_IPV6, IPV6_MINHOPCOUNT, &minttl,
sizeof(minttl));
if (ret < 0)
zlog (NULL, LOG_WARNING,
- "can't set sockopt IPV6_MINHOPCNT to %d on socket %d: %s",
+ "can't set sockopt IPV6_MINHOPCOUNT to %d on socket %d: %s",
minttl, sock, safe_strerror (errno));
return ret;
}
--
1.9.1
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev