Skip to content
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

No RDATA records in text format #110

Closed
asergeyev opened this issue Aug 29, 2014 · 2 comments
Closed

No RDATA records in text format #110

asergeyev opened this issue Aug 29, 2014 · 2 comments

Comments

@asergeyev
Copy link
Collaborator

So.. when you use Dynamic Update queries, you sometimes use no RDATA rrs, like this:
screenshot from 2014-08-28 21 41 09

RData length will be 0 and there would be text representation like this:

example.org. 0 ANY A 

This library correctly represents such text representation from something like this:

&dns.A{
    Hdr: dns.RR_Header{
        Name:     "example.org.",
        Rrtype:   dns.TypeA,
        Class:    dns.ClassANY,
        Ttl:      0,
        Rdlength: 0,
    },
    A: nil,
}.String()

but fails to parse it back into RR, this one will panic regardless of whitespace after A:

_, err := dns.NewRR("example.org. ANY A")
if err != nil { panic("got error") }

This would not affect much real world operations! I don't know where the need of parsing such records in text format would arise but IMO it worth discussion if this behavior should be considered a bug.

I did not check much but Net::DNS is installed and seem to read those properly:

$ perl -Mv5.16 -MNet::DNS -e "say  Net::DNS::RR->new('example.org. ANY A')->string();"
example.org.    0   ANY A   ; no data
@miekg
Copy link
Owner

miekg commented Aug 29, 2014

[ Quoting notifications@github.com in "[dns] No RDATA records in text form..." ]

RData length will be 0 and there would be text representation like this:

example.org. 0 ANY A

This library correctly represents such text representation from something like this:

&dns.A{
Hdr: dns.RR_Header{
Name: "example.org.",
Rrtype: dns.TypeA,
Class: dns.ClassANY,
Ttl: 0,
Rdlength: 0,
},
A: nil,
}.String()

but fails to parse it back into RR, this one will panic regardless of whitespace after A:

_, err := dns.NewRR("example.org. ANY A")
if err != nil { panic("got error") }

This would not affect much real world operations! I don't know where the need of parsing such records in text format would arise but IMO it worth discussion if this behavior should be considered a bug.

I did not check much but Net::DNS is installed and seem to read those properly:

$ perl -Mv5.16 -MNet::DNS -e "say Net::DNS::RR->new('example.org. ANY A')->string();"
example.org. 0 ANY A ; no data

Yes, this is a bug and an annoying one as well, because it effects the parsing
and the packing/unpacking functions -- although packing/unpacking should be
fine-ish.

/Miek

Miek Gieben

@miekg
Copy link
Owner

miekg commented Aug 29, 2014

[ Quoting notifications@github.com in "[dns] No RDATA records in text form..." ]

_, err := dns.NewRR("example.org. ANY A")
if err != nil { panic("got error") }

This would not affect much real world operations! I don't know where the need of parsing such records in text format would arise but IMO it worth discussion if this behavior should be considered a bug.

I did not check much but Net::DNS is installed and seem to read those properly:

$ perl -Mv5.16 -MNet::DNS -e "say Net::DNS::RR->new('example.org. ANY A')->string();"
example.org. 0 ANY A ; no data

Added TestDynamicUpdateParsing as a test and fixed some records, but more work
is needed.

/Miek

Miek Gieben

@miekg miekg closed this as completed in cbb9881 Aug 30, 2014
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

No branches or pull requests

2 participants