From 845b28909247bfb1ce4eb7ab042ceeeb4a8d5b82 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 11 Sep 2021 14:41:51 +0100 Subject: [PATCH 1/4] netbsd socketmodule CAN protocol constants addition. --- Modules/socketmodule.h | 4 ++++ configure.ac | 7 +++++++ pyconfig.h.in | 3 +++ 3 files changed, 14 insertions(+) diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index 1b35b11cdee6af..7d9870b00e633f 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -148,6 +148,10 @@ typedef int socklen_t; #include #endif +#ifdef HAVE_NETCAN_CAN_H +#include +#endif + #ifdef HAVE_SYS_SYS_DOMAIN_H #include #endif diff --git a/configure.ac b/configure.ac index eab326232b14d7..8ee801b78ead2c 100644 --- a/configure.ac +++ b/configure.ac @@ -2568,6 +2568,13 @@ AC_CHECK_HEADERS(linux/can.h linux/can/bcm.h linux/can/j1939.h linux/can/raw.h n #endif ]) +# CAN protocol constants on NetBSD are defined in this header +AC_CHECK_HEADERS(netcan/can.h,,,[ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +]) + # checks for typedefs AC_CACHE_CHECK([for clock_t in time.h], [ac_cv_clock_t_time_h], [ AC_EGREP_HEADER([clock_t], [time.h], [ac_cv_clock_t_time_h=yes], [ac_cv_clock_t_time_h=no]) diff --git a/pyconfig.h.in b/pyconfig.h.in index 383fd47dd43c81..c67e63aa6f51e0 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -688,6 +688,9 @@ /* Define if compiling using Linux 4.1 or later. */ #undef HAVE_LINUX_CAN_RAW_JOIN_FILTERS +/* Define to 1 if you have the header file. */ +#undef HAVE_NETCAN_CAN_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_MEMFD_H From 7113d49f1aa0f50e6efcb14f17e1748029d2c57e Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 11 Sep 2021 13:45:49 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst | 1 + Modules/socketmodule.c | 3 +++ configure.ac | 7 ------- 3 files changed, 4 insertions(+), 7 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst diff --git a/Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst b/Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst new file mode 100644 index 00000000000000..b97d3673d1974b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst @@ -0,0 +1 @@ +Adds CAN protocol constants for NetBSD to :mod:`socket`. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index f376513fead1b8..3a9cdd77c59d5e 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -7761,6 +7761,9 @@ PyInit__socket(void) PyModule_AddIntMacro(m, CAN_RAW_LOOPBACK); PyModule_AddIntMacro(m, CAN_RAW_RECV_OWN_MSGS); #endif +#if defined(CAN_RAW_ERR_FILTER) + PyModule_AddIntMacro(m, CAN_RAW_ERR_FILTER); +#endif #ifdef HAVE_LINUX_CAN_RAW_FD_FRAMES PyModule_AddIntMacro(m, CAN_RAW_FD_FRAMES); #endif diff --git a/configure.ac b/configure.ac index 8ee801b78ead2c..eab326232b14d7 100644 --- a/configure.ac +++ b/configure.ac @@ -2568,13 +2568,6 @@ AC_CHECK_HEADERS(linux/can.h linux/can/bcm.h linux/can/j1939.h linux/can/raw.h n #endif ]) -# CAN protocol constants on NetBSD are defined in this header -AC_CHECK_HEADERS(netcan/can.h,,,[ -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -]) - # checks for typedefs AC_CACHE_CHECK([for clock_t in time.h], [ac_cv_clock_t_time_h], [ AC_EGREP_HEADER([clock_t], [time.h], [ac_cv_clock_t_time_h=yes], [ac_cv_clock_t_time_h=no]) From 4d721a708c599b0c6d734c3711a58d49156ca391 Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Tue, 17 May 2022 00:59:12 +0200 Subject: [PATCH 3/4] Update pyconfig.h.in --- pyconfig.h.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyconfig.h.in b/pyconfig.h.in index c67e63aa6f51e0..383fd47dd43c81 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -688,9 +688,6 @@ /* Define if compiling using Linux 4.1 or later. */ #undef HAVE_LINUX_CAN_RAW_JOIN_FILTERS -/* Define to 1 if you have the header file. */ -#undef HAVE_NETCAN_CAN_H - /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_MEMFD_H From 8c50d33ea1fe1ca57303b8b9f8882a993841a85e Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 17 May 2022 19:08:48 +0100 Subject: [PATCH 4/4] NEWS correction. --- .../next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst b/Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst index b97d3673d1974b..6d5344c531c062 100644 --- a/Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst +++ b/Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst @@ -1 +1 @@ -Adds CAN protocol constants for NetBSD to :mod:`socket`. +Adds ``CAN_RAW_ERR_FILTER`` protocol constant for NetBSD to :mod:`socket`.