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..6d5344c531c062 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-09-11-13-45-47.bpo-45172.T0LUgT.rst @@ -0,0 +1 @@ +Adds ``CAN_RAW_ERR_FILTER`` protocol constant 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/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