From b454662921fd3a1fc27169e91aca03aadea08817 Mon Sep 17 00:00:00 2001 From: chrysn Date: Thu, 17 Oct 2024 19:49:12 +0200 Subject: [PATCH] gh-118986: expose `socket.IPV6_RECVERR` (#118987) --- Doc/library/socket.rst | 4 ++-- .../Library/2024-05-13-10-09-41.gh-issue-118986.-r4W9h.rst | 1 + Modules/socketmodule.c | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2024-05-13-10-09-41.gh-issue-118986.-r4W9h.rst diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 935d4a85342..0c7b9328648 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -451,8 +451,8 @@ Constants network interface instead of its name. .. versionchanged:: 3.14 - Added missing ``IP_RECVERR``, ``IP_RECVTTL``, and ``IP_RECVORIGDSTADDR`` - on Linux. + Added missing ``IP_RECVERR``, ``IPV6_RECVERR``, ``IP_RECVTTL``, and + ``IP_RECVORIGDSTADDR`` on Linux. .. versionchanged:: 3.14 Added support for ``TCP_QUICKACK`` on Windows platforms when available. diff --git a/Misc/NEWS.d/next/Library/2024-05-13-10-09-41.gh-issue-118986.-r4W9h.rst b/Misc/NEWS.d/next/Library/2024-05-13-10-09-41.gh-issue-118986.-r4W9h.rst new file mode 100644 index 00000000000..196da60a950 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-05-13-10-09-41.gh-issue-118986.-r4W9h.rst @@ -0,0 +1 @@ +Add :data:`!socket.IPV6_RECVERR` constant (available since Linux 2.2). diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 744e5e0c0b2..2764bd6e2b2 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -8578,6 +8578,9 @@ socket_exec(PyObject *m) #ifdef IPV6_RECVDSTOPTS ADD_INT_MACRO(m, IPV6_RECVDSTOPTS); #endif +#ifdef IPV6_RECVERR + ADD_INT_MACRO(m, IPV6_RECVERR); +#endif #ifdef IPV6_RECVHOPLIMIT ADD_INT_MACRO(m, IPV6_RECVHOPLIMIT); #endif