summaryrefslogtreecommitdiffstats
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-13 20:34:46 -0400
committerDavid Lamparter <equinox@opensourcerouting.org>2015-05-27 20:48:33 +0200
commit54b88cac24f335414caa875b390d2d78ff4bf9e0 (patch)
treebe4834daa2e1df592b61493ec18a084c4ccefa10 /lib/sockunion.c
parenta5d589dfbf2c563868d944376155cd4a5998722f (diff)
downloadquagga-54b88cac24f335414caa875b390d2d78ff4bf9e0.tar.bz2
quagga-54b88cac24f335414caa875b390d2d78ff4bf9e0.tar.xz
lib: wrong #define used for IPV6_MINHOPCOUNT
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. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index c7315f28..8f3540d3 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -29,6 +29,10 @@
#include "log.h"
#include "jhash.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)
@@ -506,13 +510,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;
}