[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1322231780.2403.18.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date: Fri, 25 Nov 2011 15:36:20 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: Hans Schillstrom <hans@...illstrom.com>, kaber@...sh.net,
pablo@...filter.org, jengelh@...ozas.de,
netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
hans.schillstrom@...csson.com
Subject: RE: [v4 PATCH 1/2] NETFILTER module xt_hmark, new target for HASH
based fwmark
Le vendredi 25 novembre 2011 à 14:19 +0000, David Laight a écrit :
> > + addr1 = (__force u32) ip6->saddr.s6_addr32[3];
> > + addr2 = (__force u32) ip6->daddr.s6_addr32[3];
> ...
> > + ports.v32 = * (__force u32 *) (skb->data + nhoff);
>
> Is this code even vaguely portable??
Yes it is.
> I suspect the 'ports' bit has serious endianness problems.
We dont care of endianness here, and we document it with the (__force
u32) cast.
> I'm also not sure whether linux guarantees the alignment
> of skb->data here.
It is guaranteed in whole linux stack.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists