New issue
Advanced search Search tips

Issue 896704 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 19
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Avoid hardcoding constants for little endian systems in //net

Project Member Reported by asanka@chromium.org, Oct 18

Issue description

Not sure where else this comes up but in //net/dns/dns_protocol.h the constants are hardcoded to be network order on LE systems. We shouldn't assume host bitness even though it haven't bitten us yet.

A prerequisite for that is to make base//sys_byteorder.h functions constexpr instead of inline. Note that constexpr implies inline[1] so nothing should go wrong with this plan.


[1]: [dcl.constexpr] in the C++ specification states: "A function or static data member declared with the constexpr specifier is implicitly an inline function or variable ([dcl.inline])"
 
The reason why this cleanup is additionally desirable is that the DNS code now switches between host order and network order in various code blocks. It would be nice to have some consistency throughout the code.

Components: -Internals>Network Internals>Network>DNS
Are you sure about this?  Which values, in particular, are wrong?  It looks to me like everything is applied only after going through a big endian (DNS's format) to little endian converter, so I think all the masks are correct.
Big endian to native converter, rather.
Status: WontFix (was: Available)
There was a couple of spots that the endian conversion didn't happen. I'll fix those. And yeah, there's no indication that this is a widespread problem. Sorry about the noise.
No problem!  If the conversion didn't happen, that's presumably actually a bug on little-endian systems, since DNS itself is big-endian.

Sign in to add a comment