fix _packet_subnet calculation logic#4943
Open
wenxuan70 wants to merge 2 commits intosecdev:masterfrom
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4943 +/- ##
==========================================
+ Coverage 80.28% 80.30% +0.02%
==========================================
Files 375 379 +4
Lines 92431 93099 +668
==========================================
+ Hits 74205 74761 +556
- Misses 18226 18338 +112
🚀 New features to boost your workflow:
|
Member
|
Hi and thanks for the PR ! It seems that it broke certain test cases, could you take a look? Thanks |
Contributor
Author
|
Thanks for letting me know! I'll look into the failing tests and get back to you soon. |
wenxuan70
commented
Mar 20, 2026
| MultipleTypeField( | ||
| [(ClientSubnetv4("address", "192.168.0.0", | ||
| length_from=lambda p: p.source_plen), | ||
| length_from=lambda p: p.source_plen or 16), |
Contributor
Author
There was a problem hiding this comment.
The default value of 16 here is to maintain backward compatibility: when scope_plen is None, the original _pack_subnet method computes 16 bits from the default address 192.168.0.0.
9af0e85 to
f8db4f5
Compare
…one in EDNS0ClientSubnet
f8db4f5 to
923b03d
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.
Checklist:
tox)fixes #4942