From: Chris Angelico Date: Sat, 22 Nov 2025 17:07:21 +0000 (+1100) Subject: gh-141817: Add IPV6_HDRINCL constant to the socket module (#141818) X-Git-Tag: v3.15.0a3~320 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f21ed37daf95c8100688b5a41b1094dd18517375;p=thirdparty%2FPython%2Fcpython.git gh-141817: Add IPV6_HDRINCL constant to the socket module (#141818) Co-authored-by: Victor Stinner Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- 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