Sort DNS MX and SRV records by priority#6206
Open
shblue21 wants to merge 1 commit into
Open
Conversation
vietj
reviewed
Jun 18, 2026
vietj
reviewed
Jun 18, 2026
vietj
reviewed
Jun 18, 2026
Contributor
Author
|
Thanks for review. I pushed the updates. |
0bed27f to
59a98b5
Compare
Member
|
@shblue21 can you make it a single commit that follows the commit message format that describes the motivation and outline the changes ? |
59a98b5 to
3a97c54
Compare
Contributor
Author
|
Thanks, I squashed the commits into one and updated the commit message. |
Motivation: MX and SRV lookups should return records in DNS priority order, with lower priority values first, instead of preserving the DNS answer order. Changes: Sort MX and SRV records returned by queryAll by ascending priority. Decode MX priority and SRV priority/weight fields as unsigned 16-bit values. Add regression tests and update the resolveSRV Javadoc. Signed-off-by: Jihun Kim <shblue21@naver.com>
3a97c54 to
c4f80df
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.
Fixes #6205
Motivation:
MX and SRV lookups should return records in DNS priority order, with lower priority values first, instead of preserving the DNS answer order.
This change sorts MX and SRV results by priority and decodes MX/SRV numeric fields as unsigned 16-bit values. It also adds regression tests and updates the
resolveSRV()Javadoc.Conformance:
I Have signed the ECA