alexdalitz / dnsruby

Dnsruby is a feature-complete DNS(SEC) client for Ruby, as used by many of the world's largest DNS registries and the OpenDNSSEC project
Other
194 stars 77 forks source link

Header RD flag is overwritten. #38

Closed keithrbennett closed 9 years ago

keithrbennett commented 9 years ago

If message.header.rd is set to false, when the message is sent, the flag is overwritten to true (see test method test_rd_not_overwritten in tc_resolver.rb). The code at my branch at https://github.com/keithrbennett/dnsruby/tree/fix-rd-overwriting illustrates this (1). If you run:

bundle exec ruby test/tc_resolver.rb --name test_rd_not_overwritten

...you'll see an exception raised that indicates that line 605 in PacketSender is where the value is being overwritten. I would think that sending a message should not result in any change to the original message at all -- is this wrong? If not, why is this being overwritten?

Thanks....

(1) To get a copy of this branch, do this:

git clone git@github.com:keithrbennett/dnsruby.git keith-dnsruby
cd keith-dnsruby
git checkout -b fix-rd-overwriting
git pull origin fix-rd-overwriting
alexdalitz commented 9 years ago

...you'll see an exception raised that indicates that line 605 in PacketSender is where the value is being overwritten. I would think that sending a message should not result in any change to the original message at all -- is this wrong? If not, why is this being overwritten?

Leaving aside your first question temporarily…

Yes, I think that you are wrong that sending a message should not result in any change. For example, it may be necessary to add OPT records. Or set DNSSEC bits, depending on the resolver settings.

I have had discussions with Michael Graff about this in the past, as some people do want to send that exact message, and the solution we came up with was Resolver.send_plain_message.

Does that help?

Thanks,

Alex.

keithrbennett commented 9 years ago

I was just writing about that when your message popped in. I'll mention this to the person who found this problem, and I expect that send_plain_message will work just fine. Thanks!

alexdalitz commented 9 years ago

Can we close this now please?

alexdalitz commented 9 years ago

So, given that we have established two mechanisms for your use case :

a) Configure the Resolver to stamp the message with the signature you want b) Use send_plain_message to send exactly the message that you want

can we now close this, please?

keithrbennett commented 9 years ago

Yes, we will probably just call resolver.recurse = false to achieve what we want. Thanks very much.