|
Added
Link Here
|
| 1 |
From 2571505b05f8f2970309927a8da29b94f97e7aeb Mon Sep 17 00:00:00 2001 |
| 2 |
From: =?UTF-8?q?Mina=20Gali=C4=87?= <freebsd@igalic.co> |
| 3 |
Date: Wed, 27 Sep 2023 09:24:50 +0000 |
| 4 |
Subject: [PATCH] GH-107812: extend socket's netlink support to FreeBSD 3.8 |
| 5 |
|
| 6 |
backport GH-107812 to 3.8 |
| 7 |
--- |
| 8 |
.../2023-08-09-15-37-20.gh-issue-107812.CflAXa.rst | 1 + |
| 9 |
Modules/socketmodule.h | 2 ++ |
| 10 |
configure.ac | 3 ++- |
| 11 |
pyconfig.h.in | 12 ++++++++++++ |
| 12 |
4 files changed, 17 insertions(+), 1 deletion(-) |
| 13 |
create mode 100644 Misc/NEWS.d/next/Library/2023-08-09-15-37-20.gh-issue-107812.CflAXa.rst |
| 14 |
|
| 15 |
diff --git Misc/NEWS.d/next/Library/2023-08-09-15-37-20.gh-issue-107812.CflAXa.rst Misc/NEWS.d/next/Library/2023-08-09-15-37-20.gh-issue-107812.CflAXa.rst |
| 16 |
new file mode 100644 |
| 17 |
index 0000000000..0aac44fb41 |
| 18 |
--- /dev/null |
| 19 |
+++ Misc/NEWS.d/next/Library/2023-08-09-15-37-20.gh-issue-107812.CflAXa.rst |
| 20 |
@@ -0,0 +1 @@ |
| 21 |
+Extend socket's netlink support to the FreeBSD platform. |
| 22 |
diff --git Modules/socketmodule.h Modules/socketmodule.h |
| 23 |
index dff1f8f4e9..64dc88883a 100644 |
| 24 |
--- Modules/socketmodule.h |
| 25 |
+++ Modules/socketmodule.h |
| 26 |
@@ -50,6 +50,8 @@ typedef int socklen_t; |
| 27 |
# include <asm/types.h> |
| 28 |
# endif |
| 29 |
# include <linux/netlink.h> |
| 30 |
+#elif defined(HAVE_NETLINK_NETLINK_H) |
| 31 |
+# include <netlink/netlink.h> |
| 32 |
#else |
| 33 |
# undef AF_NETLINK |
| 34 |
#endif |
| 35 |
diff --git configure.ac configure.ac |
| 36 |
index de83332dd3..c04f2fb291 100644 |
| 37 |
--- configure.ac |
| 38 |
+++ configure.ac |
| 39 |
@@ -2204,7 +2204,8 @@ AC_CHECK_HEADERS([net/if.h], [], [], |
| 40 |
]) |
| 41 |
|
| 42 |
# On Linux, netlink.h requires asm/types.h |
| 43 |
-AC_CHECK_HEADERS(linux/netlink.h,,,[ |
| 44 |
+# On FreeBSD, netlink.h is located in netlink/netlink.h |
| 45 |
+AC_CHECK_HEADERS([linux/netlink.h netlink/netlink.h], [], [], [ |
| 46 |
#ifdef HAVE_ASM_TYPES_H |
| 47 |
#include <asm/types.h> |
| 48 |
#endif |
| 49 |
diff --git pyconfig.h.in pyconfig.h.in |
| 50 |
index 41cfe07902..66e5d65788 100644 |
| 51 |
--- pyconfig.h.in |
| 52 |
+++ pyconfig.h.in |
| 53 |
@@ -715,6 +715,18 @@ |
| 54 |
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ |
| 55 |
#undef HAVE_NDIR_H |
| 56 |
|
| 57 |
+/* Define to 1 if you have the <netcan/can.h> header file. */ |
| 58 |
+#undef HAVE_NETCAN_CAN_H |
| 59 |
+ |
| 60 |
+/* Define to 1 if you have the <netdb.h> header file. */ |
| 61 |
+#undef HAVE_NETDB_H |
| 62 |
+ |
| 63 |
+/* Define to 1 if you have the <netinet/in.h> header file. */ |
| 64 |
+#undef HAVE_NETINET_IN_H |
| 65 |
+ |
| 66 |
+/* Define to 1 if you have the <netlink/netlink.h> header file. */ |
| 67 |
+#undef HAVE_NETLINK_NETLINK_H |
| 68 |
+ |
| 69 |
/* Define to 1 if you have the <netpacket/packet.h> header file. */ |
| 70 |
#undef HAVE_NETPACKET_PACKET_H |
| 71 |
|
| 72 |
-- |
| 73 |
2.42.0 |
| 74 |
|