summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/socketmodule.c6
-rw-r--r--Modules/socketmodule.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 0e27563996..1c8ef1eb3b 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -7703,7 +7703,7 @@ PyInit__socket(void)
PyModule_AddIntMacro(m, SOL_CAN_RAW);
PyModule_AddIntMacro(m, CAN_RAW);
#endif
-#ifdef HAVE_LINUX_CAN_H
+#if defined(HAVE_LINUX_CAN_H) || defined(HAVE_NETCAN_CAN_H)
PyModule_AddIntMacro(m, CAN_EFF_FLAG);
PyModule_AddIntMacro(m, CAN_RTR_FLAG);
PyModule_AddIntMacro(m, CAN_ERR_FLAG);
@@ -7718,9 +7718,11 @@ PyInit__socket(void)
PyModule_AddIntMacro(m, CAN_J1939);
#endif
#endif
-#ifdef HAVE_LINUX_CAN_RAW_H
+#if defined(HAVE_LINUX_CAN_RAW_H) || defined(HAVE_NETCAN_CAN_H)
PyModule_AddIntMacro(m, CAN_RAW_FILTER);
+#ifdef CAN_RAW_ERR_FILTER
PyModule_AddIntMacro(m, CAN_RAW_ERR_FILTER);
+#endif
PyModule_AddIntMacro(m, CAN_RAW_LOOPBACK);
PyModule_AddIntMacro(m, CAN_RAW_RECV_OWN_MSGS);
#endif
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index aea599f0ee..db26c046c3 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -129,6 +129,8 @@ typedef int socklen_t;
#ifdef HAVE_LINUX_CAN_H
# include <linux/can.h>
+#elif defined(HAVE_NETCAN_CAN_H)
+# include <netcan/can.h>
#else
# undef AF_CAN
# undef PF_CAN
@@ -253,7 +255,7 @@ typedef union sock_addr {
#ifdef HAVE_NETPACKET_PACKET_H
struct sockaddr_ll ll;
#endif
-#ifdef HAVE_LINUX_CAN_H
+#if defined(HAVE_LINUX_CAN_H) || defined(HAVE_NETCAN_CAN_H)
struct sockaddr_can can;
#endif
#ifdef HAVE_SYS_KERN_CONTROL_H