Skip to content

Correctly set EDNS buffer size through 'edns_details'#1429

Merged
tgreenx merged 1 commit intozonemaster:release-v2024.2.1from
tgreenx:fix-edns
Feb 24, 2025
Merged

Correctly set EDNS buffer size through 'edns_details'#1429
tgreenx merged 1 commit intozonemaster:release-v2024.2.1from
tgreenx:fix-edns

Conversation

@tgreenx
Copy link
Contributor

@tgreenx tgreenx commented Feb 11, 2025

Purpose

This PR proposes a fix to EDNS queries sent with edns_details (and without edns_details->size, so in test cases Nameserver{02, 10, 11, 12} which were not functioning properly - queries were sent but with an empty EDNS buffer size (0), so some name servers could not respond properly).

The cause seems that to be that setting the edns_size parameter to the underlying Zonemaster::LDNS resolver object isn't sufficient when Zonemaster::LDNS::query_with_pkt() is used. It bypasses the resolver-level properties, see ldns_resolver_send_pkt() vs ldns_resolver_send() - and in particular the omitted call to ldns_resolver_prepare_query_pkt(). We have to explicitly set it in the given Zonemaster::LDNS::Packet object.

Context

Fixes #1428

Changes

  • Always set EDNS buffer size through edns_details

How to test this PR

This is not caught in current unit tests for several reasons:

Manual testing (from #1428):

$ zonemaster-cli 131.193.130.in-addr.arpa --ns ns1.newroztelecom.com --ns ns2.newroztelecom.com --ns ns3.newroztelecom.com --ns ns4.newroztelecom.com --show-testcase --test nameserver02 --no-ipv6 --level info --raw
   0.00 INFO     Unspecified    GLOBAL_VERSION  version=v7.0.0
   0.67 INFO     Nameserver02   EDNS0_SUPPORT  ns_list=ns3.newroztelecom.com/95.170.204.172;ns4.newroztelecom.com/95.170.204.167;ns1.newroztelecom.com/93.91.200.200;ns2.newroztelecom.com/93.91.200.201

It seems that setting the 'edns_size' parameter to the underlying Zonemaster::LDNS resolver object isn't sufficient when Zonemaster::LDNS::query_with_pkt() is used.
We have to explicitly set it in the given Zonemaster::LDNS::Packet object.
@tgreenx tgreenx added A-TestCase Area: Test case specification or implementation of test case V-Patch Versioning: The change gives an update of patch in version. labels Feb 11, 2025
@tgreenx tgreenx added this to the v2024.2.1 milestone Feb 11, 2025
@tgreenx tgreenx linked an issue Feb 11, 2025 that may be closed by this pull request
Copy link
Member

@mattias-p mattias-p left a comment

Choose a reason for hiding this comment

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

LGTM!

@tgreenx tgreenx merged commit 6f5564f into zonemaster:release-v2024.2.1 Feb 24, 2025
@tgreenx tgreenx deleted the fix-edns branch February 24, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-TestCase Area: Test case specification or implementation of test case V-Patch Versioning: The change gives an update of patch in version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nameserver02 fails with EDNS error

3 participants