libnet/d/bridge: port mapping: proxy LL connections #48570
Merged
akerouanton merged 1 commit intomoby:masterfrom Oct 8, 2024
Merged
libnet/d/bridge: port mapping: proxy LL connections #48570akerouanton merged 1 commit intomoby:masterfrom
akerouanton merged 1 commit intomoby:masterfrom
Conversation
1c716b3 to
90fe6d8
Compare
Link-local connections were DNATed like other non-loopback connections, but the kernel would drop them even before their reach the container. This commit changes the DNAT rule inserted in ip6tables to exclude link-local addresses. Instead, these connections will be proxied by docker-proxy, at least if --userland-proxy=true. If dockerd is started with the userland-proxy disabled, link-local port-bindings won't be supported (ie. silently discarded). Signed-off-by: Albin Kerouanton <[email protected]>
90fe6d8 to
7ca9e9b
Compare
robmry
approved these changes
Oct 8, 2024
11 tasks
Member
|
We removed the cherry-pick label; this bug/issue has been around for a long time, and there were some merge-conflicts when back porting, that would not be worth significant effort to resolve those for a long standing issue. |
1 task
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.
- What I did
Link-local connections were DNATed like other non-loopback connections, but the kernel would drop them even before their reach the container.
This PR changes the DNAT rule inserted in ip6tables to exclude link-local addresses. Instead, these connections will be proxied by docker-proxy, at least if --userland-proxy=true.
If dockerd is started with the userland-proxy disabled, link-local port-bindings won't be supported (ie. silently discarded).
- How I did it
Debugged the issue with the help of
iptables-tracerandpwru:SYNpacket is DNAT'd to the containerSYN-ACKreachiptableson the return pathSYNpacket doesn't reachiptablesin the container's netnspwrushows that a link-local address is picked as source addr, and a ULA as destination addr.- How to verify it
The integration test
TestAccessPublishedPortFromHostintroduced in #48545 was skipping LL addrs. That's not the case anymore.- Description for the changelog
- Fix connections to published ports using link-local addresses.