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

Client dns packet id uses Random.int #165

Closed
hannesm opened this issue Jun 30, 2019 · 1 comment
Closed

Client dns packet id uses Random.int #165

hannesm opened this issue Jun 30, 2019 · 1 comment
Milestone

Comments

@hannesm
Copy link
Member

hannesm commented Jun 30, 2019

from robur-coop/udns#9

@cfcs reports:
I took a shortcut here: https://github.com/mirage/ocaml-dns/blob/master/client/dns_client.ml#L20

Leaving this issue here so we don't forget about it.

EDIT: Also it's off by one (should be 0x10000):

Random.int bound returns a random integer between 0 (inclusive)
and bound (exclusive). bound must be greater than 0 and less than 2^30.

@hannesm further reports:
Server code (and resolver) should also unify the use of random, maybe sth in dns.mli should be around that takes a rng and produces a proper id.

@hannesm
Copy link
Member Author

hannesm commented Aug 14, 2019

this has been resolved by #184 #185

@hannesm hannesm closed this as completed Aug 14, 2019
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

1 participant