libnet/pms/nat: don't bind IPv6 ports if not supported by port driver#51616
Merged
thaJeztah merged 2 commits intomoby:masterfrom Nov 28, 2025
Merged
libnet/pms/nat: don't bind IPv6 ports if not supported by port driver#51616thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah merged 2 commits intomoby:masterfrom
Conversation
cce07e3 to
7c2de75
Compare
robmry
approved these changes
Nov 28, 2025
7c2de75 to
714ba4f
Compare
In rootless mode, the Engine needs to call the rootless port driver to know which IP address it should bind to inside of its network namespace. The slirp4netns port drivers doesn't support binding to IPv6 address, so we need to detect that before listening on the port. Before commit 201968c, this wasn't a problem because the Engine was binding the port, then calling rootless port driver to learn whether the proto/IP family was supported, and listen on the port if so. Starting with that commit, the Engine does bind + listen in one go, and then calls the port driver — this is too late. Fix the bug by checking if the port driver supports the PortBindingReq, and only allocate the port if so. Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
714ba4f to
310aa92
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=slirp4netns) #51591- What I did
In rootless mode, the Engine needs to call the rootless port driver to know which IP address it should bind to inside of its network namespace.
The slirp4netns port drivers doesn't support binding to IPv6 address, so we need to detect that before listening on the port.
Before commit 201968c, this wasn't a problem because the Engine was binding the port, then calling rootless port driver to learn whether the proto/IP family was supported, and listen on the port if so.
Starting with that commit, the Engine does bind + listen in one go, and then calls the port driver — this is too late. Fix the bug by checking if the port driver supports the PortBindingReq, and only allocate the port if so.
- How to verify it
Start a rootless daemon with
DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=slirp4netns, thendocker run -p 80:80 alpine.- Human readable description for the release notes