-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"bad rdlength" error in dynamic update request #150
Comments
After thinking about this some more I realized that the first update from the FortiGate is just a delete request followed by an update/add request. After reproducing this request with nsupdate I get the same "bad rdlength" error which leads me to believe there is a bug. Here is the exact nsupdate command I used:
It apears to only happen when you specify the record type for the delete as this will produce the error:
but this will success:
Thanks. |
While writing a test case for this I've found |
Can you post where it breaks? |
This sample returns bad rdlength:
It should be an update message for the zone "example.", deleting the A RRset "example." and then adding an A record at "example.". |
Ah, thanks. Test added in I think this is order dependent :( i.e. what RR are before and/or after, which makes it annoying. I may have some time today to look into it. |
The fundamental problem here is that If have a small patch the makes the current testcase at least parse. |
See 34f43d3 |
More examples can be raised with something like: package main
import "github.com/miekg/dns"
func main() {
s := &dns.Server{Addr: ":5030", Net: "tcp"}
dns.HandleFunc(".", func(w dns.ResponseWriter, r *dns.Msg) {
m := new(dns.Msg)
m.SetReply(r)
w.WriteMsg(m)
})
s.ListenAndServe()
} #!/bin/sh
set -e
(
echo server 127.0.0.1 5030
echo zone example.
for i in `seq 1 4`; do
echo update delete $i.example. TYPE$i
done
echo show
echo send
echo answer
) | nsupdate -v |
[ Quoting notifications@github.com in "Re: [dns] "bad rdlength" error in d..." ]
Yeah, from the types and tags most stuff can be inferred. Seems like a good
Hmm. These should all be relatively easy to fix. I'll give it a whack.
Miek Gieben |
I've tried to provoke this behaviour again and been unable to—call it fixed? |
I'm porting some dynamic DNS code from python to this dns library and I'm getting an error. I have a small server that listens for DNS updates. The code works fine when requesting with nsupdate, but errors when I try with a FortiGate firewall.
The requests are not identical between the two clients but I am not sure why all other systems I've tested against seem to work fine with the FortiGate. The only difference that I can tell is that the FortiGate sends two updates (summary from wireshark):
and nsupdate just sends one:
The part of the library that throws the error is in the UnpackRR function in msg.go where it throws "bad rdlength". The first update from the FortiGate has data length of 0 but I've tried deletes from nsupdate as well that have length 0 with no problem.
I dug into the RFC but didn't find anything that would make me think what the FortiGate is trying to do is illegal.
The text was updated successfully, but these errors were encountered: