Skip to content
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

docker-proxy accepts connections before NAT rules are set up #47951

Open
robmry opened this issue Jun 11, 2024 · 1 comment
Open

docker-proxy accepts connections before NAT rules are set up #47951

robmry opened this issue Jun 11, 2024 · 1 comment
Assignees
Labels
area/networking/portmapping area/networking kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage

Comments

@robmry
Copy link
Contributor

robmry commented Jun 11, 2024

Description

Tracking review comment #47871 (comment)

#47871 means the docker-proxy process is started before NAT rules are set up.

That ensures the daemon doesn't trample iptables rules for a port that's already in-use by some other process, but it leaves a window in which docker-proxy may accept connections that it would not see once the NAT rules are in place. Those connections will be doomed, and eventually reset.

From discussion in today's networking maintainers call (@corhere, @akerouanton) - the plan is to bind the socket in the daemon, to make sure it's reserved and available, set up the iptables rules, then pass the socket to a modified docker-proxy (which can start accepting connections straight away).

The dummyProxy can then be eliminated, because all it does is bind the socket.

@robmry robmry added status/0-triage kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. area/networking area/networking/portmapping labels Jun 11, 2024
@robmry robmry self-assigned this Jun 11, 2024
@corhere
Copy link
Contributor

corhere commented Jun 13, 2024

Funny enough, binding the socket in the daemon and passing the socket fd off to the proxy process was also the plan last year! And with this plan, we could get the kernel to pick the host port for us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking/portmapping area/networking kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage
Projects
None yet
Development

No branches or pull requests

2 participants