6
84
Fork
You've already forked dns
39

Add dnsutil truncate helper #886

Open
zasdaym wants to merge 1 commit from zasdaym/dns:feat/truncate into main
pull from: zasdaym/dns:feat/truncate
merge into: miekg:main
miekg:main
miekg:miek/26/jun24wo/14
miekg:miek/26/mrt24di/tls
miekg:miek/26/mrt09ma/17
miekg:miek/26/feb15zo/13
miekg:miek/zo-07-dec-25/gslb1
miekg:miek/2025-10-26@1431
miekg:miek/2025-10-18@2017
First-time contributor
Copy link

Fixes #882

Fixes #882
Add dnsutil truncate helper
All checks were successful
/ test (pull_request) Successful in 1m23s
f6ea92ad05
miekg left a comment
Copy link

Thank you.

But this nearly doesn't do enough - I've updated the issue with some pointers. And I fail to see why some code choices are prudent.

Thank you. But this nearly doesn't do enough - I've updated the issue with some pointers. And I fail to see why some code choices are prudent.
@ -0,0 +50,4 @@
ifa==nil||b==nil{
returna==b
}
returndns.RRToType(a)==dns.RRToType(b)&&
Owner
Copy link

Is there some reason why this isn't using dnsutil.IsRRset?

Is there some reason why this isn't using dnsutil.IsRRset?
Author
First-time contributor
Copy link

No. It's better to use IsRRSet for the check.

No. It's better to use IsRRSet for the check.
@ -0,0 +55,4 @@
dns.EqualName(a.Header().Name,b.Header().Name)
}
funcclearData(m*dns.Msg){
Owner
Copy link

why does this needs to be a function, and why isn't this some defer in the Truncate function?

why does this needs to be a function, and why isn't this some `defer` in the Truncate function?
Author
First-time contributor
Copy link

I've removed the function.

I've removed the function.
@ -0,0 +102,4 @@
returni
}
funcisSameRRset(a,bdns.RR)bool{
Owner
Copy link

why is this repeated and different than sameRRset?

why is this repeated *and* different than sameRRset?
Address truncate review feedback
Some checks failed
/ test (pull_request) Has been cancelled
715f351607
Signed-off-by: Zasda Mikail <zasdaym@gmail.com>
zasdaym force-pushed feat/truncate from 715f351607
Some checks failed
/ test (pull_request) Has been cancelled
to 8910d0f4d2
Some checks failed
/ test (pull_request) Has been cancelled
2026年06月24日 03:57:37 +02:00
Compare
Owner
Copy link

I don't think this is heading in the right direction, and why are you ignoring feedback comments?

I don't think this is heading in the right direction, and why are you ignoring feedback comments?
Author
First-time contributor
Copy link

Hi, sorry I didn't read your review comments here. My latest commit is based on your feedback here.

On "heading in the wrong direction", could you say more about what you'd prefer?

Hi, sorry I didn't read your review comments here. My latest commit is based on your feedback [here](https://codeberg.org/miekg/dns/issues/882#issuecomment-17952800). On "heading in the wrong direction", could you say more about what you'd prefer?
zasdaym force-pushed feat/truncate from 8910d0f4d2
Some checks failed
/ test (pull_request) Has been cancelled
to 6186c7fbc1
Some checks failed
/ test (pull_request) Has been cancelled
2026年06月24日 12:00:39 +02:00
Compare
zasdaym force-pushed feat/truncate from 6186c7fbc1
Some checks failed
/ test (pull_request) Has been cancelled
to 7a080a3dee
Some checks failed
/ test (pull_request) Has been cancelled
2026年06月29日 15:55:21 +02:00
Compare
zasdaym force-pushed feat/truncate from 7a080a3dee
Some checks failed
/ test (pull_request) Has been cancelled
to a69f68fb2f
Some checks are pending
/ test (pull_request) Blocked by required conditions
2026年06月30日 14:55:38 +02:00
Compare
Some checks are pending
/ test (pull_request) Blocked by required conditions
This pull request can be merged automatically.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feat/truncate:zasdaym-feat/truncate
git switch zasdaym-feat/truncate

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff zasdaym-feat/truncate
git switch zasdaym-feat/truncate
git rebase main
git switch main
git merge --ff-only zasdaym-feat/truncate
git switch zasdaym-feat/truncate
git rebase main
git switch main
git merge --no-ff zasdaym-feat/truncate
git switch main
git merge --squash zasdaym-feat/truncate
git switch main
git merge --ff-only zasdaym-feat/truncate
git switch main
git merge zasdaym-feat/truncate
git push origin main
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
miekg/dns!886
Reference in a new issue
miekg/dns
No description provided.
Delete branch "zasdaym/dns:feat/truncate"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?