GH-107812: extend `socket`'s netlink support to FreeBSD (gh-107813)

This commit is contained in:
Mina Galić 2023-08-10 01:47:46 +01:00 committed by GitHub
parent 2ec16fed14
commit f50c17243a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1 @@
Extend socket's netlink support to the FreeBSD platform.

View File

@ -100,6 +100,8 @@ typedef int socklen_t;
# include <asm/types.h>
# endif
# include <linux/netlink.h>
#elif defined(HAVE_NETLINK_NETLINK_H)
# include <netlink/netlink.h>
#else
# undef AF_NETLINK
#endif

15
configure generated vendored
View File

@ -11153,6 +11153,7 @@ fi
# On Linux, netlink.h requires asm/types.h
# On FreeBSD, netlink.h is located in netlink/netlink.h
ac_fn_c_check_header_compile "$LINENO" "linux/netlink.h" "ac_cv_header_linux_netlink_h" "
#ifdef HAVE_ASM_TYPES_H
#include <asm/types.h>
@ -11167,6 +11168,20 @@ then :
printf "%s\n" "#define HAVE_LINUX_NETLINK_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "netlink/netlink.h" "ac_cv_header_netlink_netlink_h" "
#ifdef HAVE_ASM_TYPES_H
#include <asm/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
"
if test "x$ac_cv_header_netlink_netlink_h" = xyes
then :
printf "%s\n" "#define HAVE_NETLINK_NETLINK_H 1" >>confdefs.h
fi
# On Linux, qrtr.h requires asm/types.h

View File

@ -2880,7 +2880,8 @@ AC_CHECK_HEADERS([net/if.h], [], [],
])
# On Linux, netlink.h requires asm/types.h
AC_CHECK_HEADERS([linux/netlink.h], [], [], [
# On FreeBSD, netlink.h is located in netlink/netlink.h
AC_CHECK_HEADERS([linux/netlink.h netlink/netlink.h], [], [], [
#ifdef HAVE_ASM_TYPES_H
#include <asm/types.h>
#endif

View File

@ -841,6 +841,9 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the <netlink/netlink.h> header file. */
#undef HAVE_NETLINK_NETLINK_H
/* Define to 1 if you have the <netpacket/packet.h> header file. */
#undef HAVE_NETPACKET_PACKET_H