https://github.com/python/cpython/commit/9ddc388527477afdae17252628d63138631072ba
commit: 9ddc388527477afdae17252628d63138631072ba
branch: main
author: Thomas Grainger <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2024-12-26T20:20:20+05:30
summary:

gh-124761: add `socket.SO_REUSEPORT_LB` (#124961)

files:
A Misc/NEWS.d/next/Library/2024-10-04-09-56-45.gh-issue-124761.N4pSD6.rst
M Doc/library/socket.rst
M Modules/socketmodule.c

diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 58323ba6514eac..8ba2bd1dcce8cc 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -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
index 00000000000000..797dd31b368548
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-10-04-09-56-45.gh-issue-124761.N4pSD6.rst
@@ -0,0 +1 @@
+Add :data:`~socket.SO_REUSEPORT_LB` constant to :mod:`socket` for FreeBSD.
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 9394f1c940bedf..1e95be9b1bc9f4 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -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

_______________________________________________
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