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

[1.14] Author backport of #28928 (Dns proxy use original source address and port) #29086

Merged
merged 2 commits into from Nov 9, 2023

Conversation

jrajahalme
Copy link
Member

Once this PR is merged, a GitHub action will update the labels of these PRs:

 27582 28928

@jrajahalme jrajahalme added kind/backports This PR provides functionality previously merged into master. backport/1.14 This PR represents a backport for Cilium 1.14.x of a PR that was merged to main. labels Nov 9, 2023
@jrajahalme jrajahalme requested a review from a team as a code owner November 9, 2023 15:21
tklauser and others added 2 commits November 9, 2023 17:25
[ upstream commit 95e25bf ]

We have been maintaining and using that fork for a long time and it
looks like the custom changes won't make it upstream any time soon.

There are no other vendored dependencies using miekg/dns, so switching
to the cilium/dns fork shouldn't have any side effects. The fork's
module name was changed to match its import path in
cilium/dns#4.

Let's replace the github.com/miekg/dns import path by
github.com/cilium/dns to get rid of another replace directive in go.mod
and thus make life a tiny bit easier for downstream packages importing
github.com/cilium/cilium.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
[ upstream commit 9d70db8 ]

Set transparent, reuseaddr, and reuseport options and use the original
source address on connections from DNS proxy to DNS servers to allow use
of non-local source address as well as recreate sockets on the same
5-tuple without needing to wait for the TCP TIME_WAIT to finish.

Use the MagicMarkEgress mark on connections to the dns servers instead
the generic MagicMarkIdentity.

Use original source address in connections to dns servers when the source
address is not one of the host IPs. The original source address and port
can not be reused if there is already socket with them to the same
destination on the same networking namespace.

Use new dns.SharedClients to reuse DNS clients between all requests that
originate from the same source address and port. This allows multiple
different requests to be pending at the same time on the same dns Client,
which happens whenever the source pod sends multiple DNS requests from
the same resolver invocation, e.g., for A and AAAA records.

Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>

info: patch template saved to `-`
@jrajahalme
Copy link
Member Author

/test-backport-1.14

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 9, 2023
@squeed squeed merged commit 277037f into cilium:v1.14 Nov 9, 2023
55 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.14 This PR represents a backport for Cilium 1.14.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants