]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-135357: Add socket.SO_PASSRIGHTS constant (#135355)
authorSalvo 'LtWorf' Tomaselli <ltworf@users.noreply.github.com>
Mon, 27 Apr 2026 13:12:34 +0000 (15:12 +0200)
committerGitHub <noreply@github.com>
Mon, 27 Apr 2026 13:12:34 +0000 (13:12 +0000)
Constant added to Linux 6.16. See the LWN article:
https://lwn.net/Articles/1023085/

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Doc/library/socket.rst
Misc/NEWS.d/next/Core_and_Builtins/2025-06-10-17-30-55.gh-issue-135357.sUXU1W.rst [new file with mode: 0644]
Modules/socketmodule.c

index 71747d5f515a065ab32b5a1092811bc09c27670d..96bc9e7a0d61e3d65a2a970622154d529cb27e06 100644 (file)
@@ -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 (file)
index 0000000..378bb59
--- /dev/null
@@ -0,0 +1 @@
+Add support for :data:`!socket.SO_PASSRIGHTS` on Linux.
index f1a55db229e115a83d3b1b7dfd5d3565e32a6150..f5993fc8fdaab28ba01b718cf5b902cf34f085c9 100644 (file)
@@ -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