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

Port doesn't fit inside a short #25760

Closed
glenn-johansson opened this Issue Oct 9, 2018 · 1 comment

Comments

Projects
None yet
4 participants
@glenn-johansson

glenn-johansson commented Oct 9, 2018

Short's are signed 16-bit integers whereas ports are specified as unsigned 16-bit integers. Might appear in other places but noticed this issue when trying to resolve SRV records with port numbers larger than 32767. Suggestion: read and write as Int.

@chbatey

This comment has been minimized.

Member

chbatey commented Oct 31, 2018

Thanks @glenn-johansson

Checked with the spec.
TTL is an Int and is signed so that's okay.
Length is also unsigned so needs fixed
Weight and priority also unsigned 16bit so they'll also need fixed

We can't read/write them as an Int as they are 16bits but we can store them as an Int and do the conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment