6
85
Fork
You've already forked dns
39

Method to test RDLENGTH == 0 #866

Open
opened 2026年05月16日 05:29:35 +02:00 by Skyb0rg007 · 4 comments
Contributor
Copy link

For Dynamic DNS Updates (RFC 2136), the Server must perform the following test:

3.2.1. For RRs in this section whose CLASS is ANY, test to see that
TTL and RDLENGTH are both zero (0), else signal FORMERR to the
requestor.

This version of the DNS library does not expose the RDLENGTH value. It would be useful to expose a helper function that can be used to test if any arbitrary RDATA is empty. Right now I could only figure out how to test individual RDATAs. If there is already a generic method for this, let me know!

For Dynamic DNS Updates ([RFC 2136](https://datatracker.ietf.org/doc/html/rfc2136)), the Server must perform the following test: > 3.2.1. For RRs in this section whose CLASS is ANY, test to see that TTL and RDLENGTH are both zero (0), else signal FORMERR to the requestor. This version of the DNS library does not expose the `RDLENGTH` value. It would be useful to expose a helper function that can be used to test if any arbitrary `RDATA` is empty. Right now I could only figure out how to test individual `RDATA`s. If there is already a generic method for this, let me know!
Owner
Copy link

hmm, yes. This is indeed impossible to do. Adding a method just for this check seems overkill, although an Empty() method or function for both RRs, EDNS0s and RDATAs might make sense? For RDATA you can just compare to the empty struct, this code can be generated, even outside of the library (has to be a function then, but that's it)

hmm, yes. This is indeed impossible to do. Adding a method just for this check seems overkill, although an Empty() method or function for both RRs, EDNS0s and RDATAs might make sense? For RDATA you can just compare to the empty struct, this code can be generated, even outside of the library (has to be a function then, but that's it)
Owner
Copy link

Like dyn. update has other use cases to check for empty rdata? Outside of that area I don't know if this would useful?

Like dyn. update has other use cases to check for empty rdata? Outside of that area I don't know if this would useful?
Author
Contributor
Copy link

In dynamic update, this check is just used for request validation; in theory there’s no security issue with choosing to ignore the RDATA in those cases.

I don’t think it’s always possible to detect empty RDATA by comparing with the default-constructed type: all-zeros could be a valid RDATA. I’m not sure what the right answer is.

In dynamic update, this check is just used for request validation; in theory there’s no security issue with choosing to ignore the RDATA in those cases. I don’t think it’s always possible to detect empty RDATA by comparing with the default-constructed type: all-zeros could be a valid RDATA. I’m not sure what the right answer is.
Owner
Copy link

all zeros would be something that is different than no rdata, comparing to an empty rdata.XXX is the only way. But if this is the only use-case (iirc there might be another in dyn updates...?) you might be better off just writing or generating your own

all zeros would be something that is different than no rdata, comparing to an empty `rdata.XXX` is the only way. But if this is the only use-case (iirc there might be another in dyn updates...?) you might be better off just writing or generating your own
Sign in to join this conversation.
No Branch/Tag specified
main
miek/26/jun24wo/14
miek/26/mrt24di/tls
miek/26/mrt09ma/17
miek/26/feb15zo/13
miek/zo-07-dec-25/gslb1
miek/2025-10-26@1431
miek/2025-10-18@2017
v0.6.83
v0.6.82
v0.6.81
v0.6.80
v0.6.79
v0.6.78
v0.6.77
v0.6.76
v0.6.75
v0.6.74
v0.6.73
v0.6.72
v0.6.71
v0.6.70
v0.6.69
v0.6.68
v0.6.67
v0.6.66
v0.6.65
v0.6.64
v0.6.63
v0.6.62
v0.6.61
v0.6.60
v0.6.59
v0.6.58
v0.6.57
v0.6.56
v0.6.55
v0.6.54
v0.6.53
v0.6.52
v0.6.51
v0.6.50
v0.6.49
v0.6.48
v0.6.47
v0.6.46
v0.6.45
v0.6.44
v0.6.43
v0.6.42
v0.6.41
v0.6.40
v0.6.39
v0.6.38
v0.6.37
v0.6.36
v0.6.35
v0.6.34
v0.6.33
v0.6.32
v0.6.31
v0.6.30
v0.6.29
v0.6.28
v0.6.27
v0.6.26
v0.6.25
v0.6.24
v0.6.23
v0.6.22
v0.6.21
v0.6.20
v0.6.19
v0.6.18
v0.6.17
v0.6.16
v0.6.15
v0.6.14
v0.6.13
v0.6.12
v0.6.11
v0.6.10
v0.6.9
v0.6.8
v0.6.7
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.38
v0.5.37
v0.5.36
v0.5.35
v0.5.34
v0.5.33
v0.5.32
v0.5.31
v0.5.30
v0.5.29
v0.5.28
v0.5.27
v0.5.26
v0.5.25
v0.5.24
v0.5.23
v0.5.22
v0.5.21
v0.5.20
v0.5.19
v0.5.18
v0.5.17
v0.5.16
v0.5.15
v0.5.14
v0.5.13
v0.5.12
v0.5.11
v0.5.10
v0.5.9
v0.5.8
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.1.12
v0.1.11
v0.1.10
v0.1.9
v0.1.8
v0.1.7
v0.1.6
v0.1.5
v0.1.4
v0.0.4
v0.0.3
v0.0.2
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#866
Reference in a new issue
miekg/dns
No description provided.
Delete branch "%!s()"

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?