Skip to content

Commit 9cfc0ed

Browse files
committed
GH-107812: extend socket's netlink support to FreeBSD
on FreeBSD, netlink.h lives under netlink. Extend the AC_HEADER_CHECK to look there as well.
1 parent 0a7f48b commit 9cfc0ed

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

Modules/socketmodule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ typedef int socklen_t;
100100
# include <asm/types.h>
101101
# endif
102102
# include <linux/netlink.h>
103+
#elif defined(HAVE_NETLINK_NETLINK_H)
104+
# include <netlink/netlink.h>
103105
#else
104106
# undef AF_NETLINK
105107
#endif

configure

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2880,7 +2880,8 @@ AC_CHECK_HEADERS([net/if.h], [], [],
28802880
])
28812881

28822882
# On Linux, netlink.h requires asm/types.h
2883-
AC_CHECK_HEADERS([linux/netlink.h], [], [], [
2883+
# On FreeBSD, netlink.h is located in netlink/netlink.h
2884+
AC_CHECK_HEADERS([linux/netlink.h netlink/netlink.h], [], [], [
28842885
#ifdef HAVE_ASM_TYPES_H
28852886
#include <asm/types.h>
28862887
#endif

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,9 @@
841841
/* Define to 1 if you have the <netinet/in.h> header file. */
842842
#undef HAVE_NETINET_IN_H
843843

844+
/* Define to 1 if you have the <netlink/netlink.h> header file. */
845+
#undef HAVE_NETLINK_NETLINK_H
846+
844847
/* Define to 1 if you have the <netpacket/packet.h> header file. */
845848
#undef HAVE_NETPACKET_PACKET_H
846849

0 commit comments

Comments
 (0)