8000 gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets by mgorny · Pull Request #128933 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128916: Do not set SO_REUSEPORT on non-AF_INET* sockets #128933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2025

Conversation

mgorny
Copy link
Contributor
@mgorny mgorny commented Jan 17, 2025

Do not attempt to set SO_REUSEPORT on sockets of address familifies other than AF_INET and AF_INET6, as it is meaningless with these address families, and the call with fail with Linux kernel 6.12.9 and newer.

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Copy link
Contributor
@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@gpshead gpshead added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jan 18, 2025
@gpshead gpshead merged commit 3829104 into python:main Jan 18, 2025
46 checks passed
@miss-islington-app
Copy link

Thanks @mgorny for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 18, 2025
…ythonGH-128933)

* pythongh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.

* Apply suggestions from code review

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>

---------
(cherry picked from commit 3829104)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
@bedevere-app
Copy link
bedevere-app bot commented Jan 18, 2025

GH-128969 is a backport of this pull request to the 3.13 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 18, 2025
…ythonGH-128933)

* pythongh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.

* Apply suggestions from code review

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>

---------
(cherry picked from commit 3829104)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jan 18, 2025
@bedevere-app
Copy link
bedevere-app bot commented Jan 18, 2025

GH-128970 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Jan 18, 2025
gpshead pushed a commit that referenced this pull request Jan 18, 2025
…GH-128933) (#128970)

gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets (GH-128933)

* gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.

* Apply suggestions from code review



---------
(cherry picked from commit 3829104)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
gpshead pushed a commit that referenced this pull request Jan 18, 2025
…GH-128933) (#128969)

gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets (GH-128933)

* gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.

* Apply suggestions from code review



---------
(cherry picked from commit 3829104)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
@mgorny mgorny deleted the no-reuseport-on-unix-sockets-128916 branch January 18, 2025 07:17
@mgorny
Copy link
Contributor Author
mgorny commented Jan 18, 2025

Thanks! The test failure only affected 3.14, but I guess the change per se makes sense for older branches as well (for user code).

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 21, 2025
…ythonGH-128933)

* pythongh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.

* Apply suggestions from code review

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>

---------

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
befeleme pushed a commit to fedora-python/cpython that referenced this pull request Jan 21, 2025
…ockets (pythonGH-128933)

* pythongh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.

* Apply suggestions from code review

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>

---------

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0