mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
gh-96534: socketmodule: support FreeBSD divert(4) socket (#96536)
This commit is contained in:
parent
fdcb49c36b
commit
b17d32c114
3 changed files with 25 additions and 0 deletions
|
@ -509,6 +509,17 @@ Constants
|
||||||
.. versionadded:: 3.9
|
.. versionadded:: 3.9
|
||||||
|
|
||||||
|
|
||||||
|
.. data:: AF_DIVERT
|
||||||
|
PF_DIVERT
|
||||||
|
|
||||||
|
These two constants, documented in the FreeBSD divert(4) manual page, are
|
||||||
|
also defined in the socket module.
|
||||||
|
|
||||||
|
.. availability:: FreeBSD >= 14.0.
|
||||||
|
|
||||||
|
.. versionadded:: 3.12
|
||||||
|
|
||||||
|
|
||||||
.. data:: AF_PACKET
|
.. data:: AF_PACKET
|
||||||
PF_PACKET
|
PF_PACKET
|
||||||
PACKET_*
|
PACKET_*
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Support divert(4) added in FreeBSD 14.
|
|
@ -1903,6 +1903,11 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
|
||||||
/* RDS sockets use sockaddr_in: fall-through */
|
/* RDS sockets use sockaddr_in: fall-through */
|
||||||
#endif /* AF_RDS */
|
#endif /* AF_RDS */
|
||||||
|
|
||||||
|
#ifdef AF_DIVERT
|
||||||
|
case AF_DIVERT:
|
||||||
|
/* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
|
||||||
|
#endif /* AF_DIVERT */
|
||||||
|
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
{
|
{
|
||||||
struct maybe_idna host = {NULL, NULL};
|
struct maybe_idna host = {NULL, NULL};
|
||||||
|
@ -7683,6 +7688,14 @@ socket_exec(PyObject *m)
|
||||||
ADD_INT_MACRO(m, AF_SYSTEM);
|
ADD_INT_MACRO(m, AF_SYSTEM);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* FreeBSD divert(4) */
|
||||||
|
#ifdef PF_DIVERT
|
||||||
|
PyModule_AddIntMacro(m, PF_DIVERT);
|
||||||
|
#endif
|
||||||
|
#ifdef AF_DIVERT
|
||||||
|
PyModule_AddIntMacro(m, AF_DIVERT);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef AF_PACKET
|
#ifdef AF_PACKET
|
||||||
ADD_INT_MACRO(m, AF_PACKET);
|
ADD_INT_MACRO(m, AF_PACKET);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue