]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd-ttl-fix.patch
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 01:46:10 +0000 (18:46 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 01:46:10 +0000 (18:46 -0700)
BGP: Fix MINTTL and IPV6_MINHOPCOUNT

The #defines for IP_MINTTL and IPV6_MINHOPCOUNT need to be handled
correctly as part of the configure.ac code. Instead of hard coding
the values directly in the code

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
configure.ac
lib/sockunion.c

index 83820e4536d993a571180f44e7f56cf557f8bd50..309604eb30a21b80cfbc1e4605bfa47a3540c5f8 100755 (executable)
@@ -1218,6 +1218,12 @@ dnl ----------
     AC_MSG_CHECKING(for GNU libc >= 2.1)
     AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
     AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
+    dnl Linux has a compilation problem with mixing
+    dnl netinet/in.h and linux/in6.h they are not
+    dnl compatible.  There has been discussion on
+    dnl how to fix it but no real progress on implementation
+    dnl when they fix it, remove this
+    AC_DEFINE(IPV6_MINHOPCOUNT, 73, Linux ipv6 Min Hop Count)
 
     AC_EGREP_CPP(yes, [
 #include <features.h>
index a59bb77f38929765d6989fba5fdee051aa24ad3c..efd41362c6c723bc62850455ebb27eee72c4f080 100644 (file)
@@ -496,16 +496,6 @@ sockopt_cork (int sock, int onoff)
 #endif
 }
 
-/* For some crazy reason, our build doesn't seem to pick this up */
-#ifdef GNU_LINUX
-#ifndef IP_MINTTL
-#define IP_MINTTL 21
-#endif
-#ifndef IPV6_MINHOPCNT
-#define IPV6_MINHOPCNT 73
-#endif
-#endif
-
 int
 sockopt_minttl (int family, int sock, int minttl)
 {
@@ -520,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;
     }