Skip to content

IPv4 sugar#17743

Open
miodvallat wants to merge 3 commits into
PowerDNS:masterfrom
miodvallat:inet_atonishment
Open

IPv4 sugar#17743
miodvallat wants to merge 3 commits into
PowerDNS:masterfrom
miodvallat:inet_atonishment

Conversation

@miodvallat

Copy link
Copy Markdown
Contributor

Short description

For $reasons, creation of a ComboAddress object (wrapping either an IPv4 address, or an IPv6 address, or a Unix domain socket), is strict when trying to parse its address specification as IPv4, and requires a four-digits-with-dots-in-between address, by using inet_pton.

However, many other parts of the code use inet_aton to parse IPv4 addresses, which allows for the shorter notations preferred by the greybeards.

This PR therefore changes this to use inet_aton, giving you enough rope to break your configurations. If you had a working configuration, it will keep working and you don't have to worry anyway.

As a bonus, you get an extra inet_aton-related cleanup commit, because why not.

Fixes #6149.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document, including the AI Policy, and added a "Signed-off-by" to my commits
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

Fixes: PowerDNS#6149

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
rgacogne
rgacogne previously approved these changes Jul 17, 2026

@rgacogne rgacogne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
@coveralls

coveralls commented Jul 17, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29562484365

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.5%) to 71.142%

Details

  • Coverage increased (+0.5%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • 3042 coverage regressions across 85 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

3042 previously-covered lines in 85 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
pdns/recursordist/syncres.cc 315 81.44%
pdns/recursordist/test-syncres_cc5.cc 237 73.49%
pdns/misc.cc 235 61.88%
pdns/iputils.hh 166 76.26%
pdns/validate.cc 106 69.26%
pdns/protozero-trace.cc 101 72.84%
pdns/recursordist/aggressive_nsec.cc 101 66.41%
pdns/recursordist/recursor_cache.cc 84 86.17%
pdns/dnsparser.cc 83 85.42%
pdns/dnspacket.cc 73 72.39%

Coverage Stats

Coverage Status
Relevant Lines: 171998
Covered Lines: 134149
Line Coverage: 77.99%
Relevant Branches: 82270
Covered Branches: 46743
Branch Coverage: 56.82%
Branches in Coverage %: Yes
Coverage Strength: 6775421.4 hits per line

💛 - Coveralls

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.

Fatal error: Unable to convert '10' to a netmask

3 participants