Annotation of pkgsrc/lang/python310/patches/patch-Modules_socketmodule.c, revision 1.2
1.2 ! jperkin 1: $NetBSD: patch-Modules_socketmodule.c,v 1.1 2021/10/05 19:07:13 adam Exp $
1.1 adam 2:
3: Support NetBSD's socketcan implementation
4:
1.2 ! jperkin 5: --- Modules/socketmodule.c.orig 2022-01-13 18:52:14.000000000 +0000
1.1 adam 6: +++ Modules/socketmodule.c
1.2 ! jperkin 7: @@ -2112,7 +2112,7 @@ getsockaddrarg(PySocketSockObject *s, Py
1.1 adam 8: PyObject *interfaceName;
9: struct ifreq ifr;
10: Py_ssize_t len;
11: - struct sockaddr_can *addr = &addrbuf->can;
12: + struct sockaddr_can *addr = (struct sockaddr_can *)addrbuf;
13:
14: if (!PyTuple_Check(args)) {
15: PyErr_Format(PyExc_TypeError,
1.2 ! jperkin 16: @@ -5440,7 +5440,7 @@ socket_sethostname(PyObject *self, PyObj
! 17: Py_buffer buf;
! 18: int res, flag = 0;
! 19:
! 20: -#ifdef _AIX
! 21: +#if defined(_AIX) || (defined(__sun) && PKGSRC_OPSYS_VERSION < 051100)
! 22: /* issue #18259, not declared in any useful header file */
! 23: extern int sethostname(const char *, size_t);
! 24: #endif
! 25: @@ -7782,6 +7782,20 @@ PyInit__socket(void)
1.1 adam 26:
27: PyModule_AddIntMacro(m, J1939_FILTER_MAX);
28: #endif
29: +#ifdef HAVE_NETCAN_CAN_H
30: + PyModule_AddIntMacro(m, CAN_EFF_FLAG);
31: + PyModule_AddIntMacro(m, CAN_RTR_FLAG);
32: + PyModule_AddIntMacro(m, CAN_ERR_FLAG);
33: +
34: + PyModule_AddIntMacro(m, CAN_SFF_MASK);
35: + PyModule_AddIntMacro(m, CAN_EFF_MASK);
36: + PyModule_AddIntMacro(m, CAN_ERR_MASK);
37: +
38: + PyModule_AddIntMacro(m, CAN_RAW_FILTER);
39: + /* PyModule_AddIntMacro(m, CAN_RAW_ERR_FILTER); */
40: + PyModule_AddIntMacro(m, CAN_RAW_LOOPBACK);
41: + PyModule_AddIntMacro(m, CAN_RAW_RECV_OWN_MSGS);
42: +#endif
43: #ifdef SOL_RDS
44: PyModule_AddIntMacro(m, SOL_RDS);
45: #endif
CVSweb <webmaster@jp.NetBSD.org>