Closed ebroder closed 12 years ago
Hi @ebroder, thanks for the patch!
Is seems that the error Header::DuplicateIDError
is no longer in use, we can remove it.
If you can make this change, then I'll merge the patch.
Thanks.
@weppos Thanks for the quick review - I've pushed an update that drops the exception class.
Merged, thank you! I'll release a new version later today. I want to take the time to cleanup a little bit the Header
class and make it less Ruby 1.6 style, now that we attacked it.
Protection against the Kaminsky attack requires query IDs to be random, but it doesn't require them to be unique. And since net-dns opens a new socket for each query it performs, it doesn't rely on the uniqueness of the query ID to map requests to responses.
Requiring unique query IDs limits net-dns to only making 65535 lookups before it starts spinning in circles, trying to generate a query ID it hasn't seen before, when in fact they have all been generated.
So instead, generate random query IDs, but don't require them to be unique.