Re: [PATCH] endianness bug in ip6_tunnel

2007-07-21 Thread David Miller
From: Al Viro <[EMAIL PROTECTED]> Date: Sat, 21 Jul 2007 09:12:31 +0100 > IPV6_TCLASS_MASK is net-endian; what happens here is that we take > a value and shove it into bits 20--27 of net-endian 32bit word. > IOW, it's misannotated (it's really htonl, not ntohl) *and* the > mask should be applied a

[PATCH] endianness bug in ip6_tunnel

2007-07-21 Thread Al Viro
IPV6_TCLASS_MASK is net-endian; what happens here is that we take a value and shove it into bits 20--27 of net-endian 32bit word. IOW, it's misannotated (it's really htonl, not ntohl) *and* the mask should be applied after conversion to net-endian, not before it. The former is harmless, the latter