]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-124761: add `socket.SO_REUSEPORT_LB` (#124961)
authorThomas Grainger <tagrain@gmail.com>
Thu, 26 Dec 2024 14:50:20 +0000 (14:50 +0000)
committerGitHub <noreply@github.com>
Thu, 26 Dec 2024 14:50:20 +0000 (20:20 +0530)
Doc/library/socket.rst
Misc/NEWS.d/next/Library/2024-10-04-09-56-45.gh-issue-124761.N4pSD6.rst [new file with mode: 0644]
Modules/socketmodule.c

index 58323ba6514eace7ff0a4d90266a71d6d32525f1..8ba2bd1dcce8cccea00e281957ecd87ed6a32ec7 100644 (file)
@@ -674,6 +674,14 @@ Constants
 
   .. availability:: Linux >= 3.9
 
+.. data:: SO_REUSEPORT_LB
+
+   Constant to enable duplicate address and port bindings with load balancing.
+
+  .. versionadded:: next
+
+  .. availability:: FreeBSD >= 12.0
+
 .. data:: AF_HYPERV
           HV_PROTOCOL_RAW
           HVSOCKET_CONNECT_TIMEOUT
diff --git a/Misc/NEWS.d/next/Library/2024-10-04-09-56-45.gh-issue-124761.N4pSD6.rst b/Misc/NEWS.d/next/Library/2024-10-04-09-56-45.gh-issue-124761.N4pSD6.rst
new file mode 100644 (file)
index 0000000..797dd31
--- /dev/null
@@ -0,0 +1 @@
+Add :data:`~socket.SO_REUSEPORT_LB` constant to :mod:`socket` for FreeBSD.
index 9394f1c940bedf2f0b9e182d2835a614f6f73d18..1e95be9b1bc9f4ff4b38db9490f4a501a93e0a12 100644 (file)
@@ -7916,6 +7916,9 @@ socket_exec(PyObject *m)
     ADD_INT_MACRO(m, SO_REUSEPORT);
 #endif
 #endif
+#ifdef  SO_REUSEPORT_LB
+    ADD_INT_MACRO(m, SO_REUSEPORT_LB);
+#endif
 #ifdef  SO_SNDBUF
     ADD_INT_MACRO(m, SO_SNDBUF);
 #endif