Skip to content

Add resolver/recursor configuration to avoid udp ports#2487

Merged
djc merged 6 commits intohickory-dns:mainfrom
divergentdave:david/avoid-udp-ports
Oct 4, 2024
Merged

Add resolver/recursor configuration to avoid udp ports#2487
djc merged 6 commits intohickory-dns:mainfrom
divergentdave:david/avoid-udp-ports

Conversation

@divergentdave
Copy link
Collaborator

This addresses #1722 for UDP sockets by adding configuration options to avoid binding to a list of local UDP ports. I added a builder for UdpClientStream to clean up the existing constructors, and add the ability to pass on this new configuration. (note that two of the existing constructors were identical save for argument order) I put the list of ports to avoid in an Arc from ResolverOpts and onward, to avoid cloning HashSets after startup.

I manually tested this by adding a bias to the random port selection and extra logging statements, and confirming that the new rejection sampling loop kicked in.

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

Mostly LGTM!

@divergentdave divergentdave force-pushed the david/avoid-udp-ports branch from c3e23b5 to 657472f Compare October 2, 2024 22:19
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

LGTM modulo two more small nits.

@divergentdave divergentdave force-pushed the david/avoid-udp-ports branch from 657472f to 445eeee Compare October 3, 2024 15:08
@djc djc added this pull request to the merge queue Oct 4, 2024
@djc
Copy link
Member

djc commented Oct 4, 2024

Thanks!

Merged via the queue into hickory-dns:main with commit 7a02fe6 Oct 4, 2024
@divergentdave divergentdave deleted the david/avoid-udp-ports branch October 7, 2024 14:19
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.

2 participants