Avoid hardcoding constants for little endian systems in //net |
|||
Issue descriptionNot 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])"
,
Oct 18
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.
,
Oct 18
Big endian to native converter, rather.
,
Oct 19
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.
,
Oct 19
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 |
|||
Comment 1 by asanka@chromium.org
, Oct 18