From: Thomas Grainger Date: Thu, 26 Dec 2024 14:50:20 +0000 (+0000) Subject: gh-124761: add `socket.SO_REUSEPORT_LB` (#124961) X-Git-Tag: v3.14.0a4~190 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ddc388527477afdae17252628d63138631072ba;p=thirdparty%2FPython%2Fcpython.git gh-124761: add `socket.SO_REUSEPORT_LB` (#124961) --- diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 58323ba6514e..8ba2bd1dcce8 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 000000000000..797dd31b3685 --- /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 9394f1c940be..1e95be9b1bc9 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