From f21ed37daf95c8100688b5a41b1094dd18517375 Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Sun, 23 Nov 2025 04:07:21 +1100 Subject: [PATCH] gh-141817: Add IPV6_HDRINCL constant to the socket module (#141818) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Co-authored-by: Victor Stinner Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Doc/library/socket.rst | 3 +++ .../Library/2025-11-21-21-14-10.gh-issue-141817._v5LdB.rst | 1 + Modules/socketmodule.c | 3 +++ 3 files changed, 7 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2025-11-21-21-14-10.gh-issue-141817._v5LdB.rst diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 89bca9b5b20d..976136885eac 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -482,6 +482,9 @@ The AF_* and SOCK_* constants are now :class:`AddressFamily` and .. versionchanged:: 3.14 Added support for ``TCP_QUICKACK`` on Windows platforms when available. + .. versionchanged:: next + ``IPV6_HDRINCL`` was added. + .. data:: AF_CAN PF_CAN diff --git a/Misc/NEWS.d/next/Library/2025-11-21-21-14-10.gh-issue-141817._v5LdB.rst b/Misc/NEWS.d/next/Library/2025-11-21-21-14-10.gh-issue-141817._v5LdB.rst new file mode 100644 index 000000000000..774e13b2129f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-11-21-21-14-10.gh-issue-141817._v5LdB.rst @@ -0,0 +1 @@ +Add :data:`!socket.IPV6_HDRINCL` constant. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 6a844d44bf08..1ef359cb265e 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -8901,6 +8901,9 @@ socket_exec(PyObject *m) #ifdef IPV6_HOPLIMIT ADD_INT_MACRO(m, IPV6_HOPLIMIT); #endif +#ifdef IPV6_HDRINCL + ADD_INT_MACRO(m, IPV6_HDRINCL); +#endif #ifdef IPV6_HOPOPTS ADD_INT_MACRO(m, IPV6_HOPOPTS); #endif -- 2.47.3