mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 09:52:27 +00:00
bgpd-ttl-fix.patch
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>
This commit is contained in:
parent
e5cc509c34
commit
d8dc52578c
@ -1218,6 +1218,12 @@ dnl ----------
|
|||||||
AC_MSG_CHECKING(for GNU libc >= 2.1)
|
AC_MSG_CHECKING(for GNU libc >= 2.1)
|
||||||
AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
|
AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
|
||||||
AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
|
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, [
|
AC_EGREP_CPP(yes, [
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
|
@ -496,16 +496,6 @@ sockopt_cork (int sock, int onoff)
|
|||||||
#endif
|
#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
|
int
|
||||||
sockopt_minttl (int family, int sock, int minttl)
|
sockopt_minttl (int family, int sock, int minttl)
|
||||||
{
|
{
|
||||||
@ -520,13 +510,13 @@ sockopt_minttl (int family, int sock, int minttl)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* IP_MINTTL */
|
#endif /* IP_MINTTL */
|
||||||
#ifdef IPV6_MINHOPCNT
|
#ifdef IPV6_MINHOPCOUNT
|
||||||
if (family == AF_INET6)
|
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)
|
if (ret < 0)
|
||||||
zlog (NULL, LOG_WARNING,
|
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));
|
minttl, sock, safe_strerror (errno));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user