Skip to content

Commit

Permalink
build: run autoupdate
Browse files Browse the repository at this point in the history
AC_TRY_COMPILE is deprecated too.  Also configure.ac isn't executable.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
  • Loading branch information
eqvinox committed Apr 21, 2021
1 parent 19083e4 commit 1b636c0
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 43 deletions.
109 changes: 66 additions & 43 deletions configure.ac
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
##
AC_PREREQ([2.60])
AC_PREREQ([2.69])

AC_INIT([frr], [7.7-dev], [https://github.com/frrouting/frr/issues])
PACKAGE_URL="https://frrouting.org/"
Expand Down Expand Up @@ -1520,24 +1520,22 @@ FRR_INCLUDES
#endif
])dnl

AC_MSG_CHECKING([for BSD struct ip_mreq hack])
AC_TRY_COMPILE([#include <sys/param.h>],
[#if (defined(__FreeBSD__) && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__DragonFly__) || defined(__sun)
return (0);
#else
#error No support for BSD struct ip_mreq hack detected
#endif],[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_BSD_STRUCT_IP_MREQ_HACK], [1], [Can pass ifindex in struct ip_mreq])],
AC_MSG_RESULT([no]))

AC_MSG_CHECKING([for RFC3678 protocol-independed API])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <netinet/in.h>
], [struct group_req gr; int sock; setsockopt(sock, IPPROTO_IP, MCAST_JOIN_GROUP, (void*)&gr, sizeof(gr));
], [AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_RFC3678], [1], [Have RFC3678 protocol-independed API])],
AC_MSG_RESULT([no]))
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <netinet/in.h>
]], [[
struct group_req gr;
int sock;
setsockopt(sock, IPPROTO_IP, MCAST_JOIN_GROUP, (void*)&gr, sizeof(gr));
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_RFC3678], [1], [Have RFC3678 protocol-independed API])
],[
AC_MSG_RESULT(no)
])

dnl ---------------------------------------------------------------
dnl figure out how to check link-state
Expand Down Expand Up @@ -2134,64 +2132,84 @@ dnl -----------------------
dnl checking for IP_PKTINFO
dnl -----------------------
AC_MSG_CHECKING([for IP_PKTINFO])
AC_TRY_COMPILE([#include <netdb.h>], [
int opt = IP_PKTINFO;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netdb.h>
]], [[
int opt = IP_PKTINFO;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_PKTINFO], [1], [Have IP_PKTINFO])
], [
],[
AC_MSG_RESULT([no])
])

dnl ---------------------------
dnl checking for IP_RECVDSTADDR
dnl ---------------------------
AC_MSG_CHECKING([for IP_RECVDSTADDR])
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_RECVDSTADDR;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_RECVDSTADDR;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_RECVDSTADDR], [1], [Have IP_RECVDSTADDR])
], [
],[
AC_MSG_RESULT([no])
])

dnl ----------------------
dnl checking for IP_RECVIF
dnl ----------------------
AC_MSG_CHECKING([for IP_RECVIF])
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_RECVIF;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_RECVIF;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_RECVIF], [1], [Have IP_RECVIF])
], [
],[
AC_MSG_RESULT([no])
])

dnl ----------------------
dnl checking for SO_BINDANY
dnl ----------------------
AC_MSG_CHECKING([for SO_BINDANY])
AC_TRY_COMPILE([#include <sys/socket.h>], [
int opt = SO_BINDANY;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <sys/socket.h>
]], [[
int opt = SO_BINDANY;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_SO_BINDANY], [1], [Have SO_BINDANY])
], [
],[
AC_MSG_RESULT([no])
])

dnl ----------------------
dnl checking for IP_FREEBIND
dnl ----------------------
AC_MSG_CHECKING([for IP_FREEBIND])
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_FREEBIND;
], [
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_FREEBIND;
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_FREEBIND], [1], [Have IP_FREEBIND])
], [
],[
AC_MSG_RESULT([no])
])

Expand Down Expand Up @@ -2293,12 +2311,17 @@ dnl capabilities checks
dnl -------------------
if test "$enable_capabilities" != "no"; then
AC_MSG_CHECKING([whether prctl PR_SET_KEEPCAPS is available])
AC_TRY_COMPILE([#include <sys/prctl.h>], [prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
[AC_MSG_RESULT([yes])
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <sys/prctl.h>
]], [[
prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
]])
],[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PR_SET_KEEPCAPS], [1], [prctl])
frr_ac_keepcaps="yes"],
AC_MSG_RESULT([no])
)
frr_ac_keepcaps="yes"
],[AC_MSG_RESULT(no)
])
if test "$frr_ac_keepcaps" = "yes"; then
AC_CHECK_HEADERS([sys/capability.h])
fi
Expand Down
10 changes: 10 additions & 0 deletions lib/sockopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
#include "sockunion.h"
#include "lib_errors.h"

#if (defined(__FreeBSD__) \
&& ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) \
|| (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) \
|| (defined(__NetBSD__) && defined(__NetBSD_Version__) \
&& __NetBSD_Version__ >= 106010000) \
|| defined(__OpenBSD__) || defined(__APPLE__) \
|| defined(__DragonFly__) || defined(__sun)
#define HAVE_BSD_STRUCT_IP_MREQ_HACK
#endif

void setsockopt_so_recvbuf(int sock, int size)
{
int orig_req = size;
Expand Down

0 comments on commit 1b636c0

Please sign in to comment.