https://github.com/python/cpython/commit/f4a726da402fc0e18994f8b607302800db56f101
commit: f4a726da402fc0e18994f8b607302800db56f101
branch: main
author: Salvo 'LtWorf' Tomaselli <[email protected]>
committer: vstinner <[email protected]>
date: 2026-04-27T13:12:34Z
summary:

GH-135357: Add socket.SO_PASSRIGHTS constant (#135355)

Constant added to Linux 6.16. See the LWN article:
https://lwn.net/Articles/1023085/

Co-authored-by: Brian Schubert <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>

files:
A 
Misc/NEWS.d/next/Core_and_Builtins/2025-06-10-17-30-55.gh-issue-135357.sUXU1W.rst
M Doc/library/socket.rst
M Modules/socketmodule.c

diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 71747d5f515a06..96bc9e7a0d61e3 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -486,6 +486,7 @@ The AF_* and SOCK_* constants are now 
:class:`AddressFamily` and
 
    .. versionchanged:: 3.15
       ``IPV6_HDRINCL`` was added.
+      Added support for ``SO_PASSRIGHTS`` on Linux platforms when available.
 
 
 .. data:: AF_CAN
diff --git 
a/Misc/NEWS.d/next/Core_and_Builtins/2025-06-10-17-30-55.gh-issue-135357.sUXU1W.rst
 
b/Misc/NEWS.d/next/Core_and_Builtins/2025-06-10-17-30-55.gh-issue-135357.sUXU1W.rst
new file mode 100644
index 00000000000000..378bb59de7930a
--- /dev/null
+++ 
b/Misc/NEWS.d/next/Core_and_Builtins/2025-06-10-17-30-55.gh-issue-135357.sUXU1W.rst
@@ -0,0 +1 @@
+Add support for :data:`!socket.SO_PASSRIGHTS` on Linux.
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index f1a55db229e115..f5993fc8fdaab2 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -8276,6 +8276,9 @@ socket_exec(PyObject *m)
 #ifdef  SO_BINDTODEVICE
     ADD_INT_MACRO(m, SO_BINDTODEVICE);
 #endif
+#ifdef  SO_PASSRIGHTS
+    ADD_INT_MACRO(m, SO_PASSRIGHTS);
+#endif
 #ifdef  SO_BINDTOIFINDEX
     ADD_INT_MACRO(m, SO_BINDTOIFINDEX);
 #endif

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to