Thread (15 messages) flat view 15 messages, 5 authors, 2012-05-15

RE: [PATCH] netfilter: xt_HMARK: endian bugs

From: Hans Schillström <hidden>
Date: 2012-05-15 07:33:17
Also in: netfilter-devel

On Mon, 2012-05-14 at 17:05 +0200, Jan Engelhardt wrote:
On Monday 2012-05-14 16:40, Pablo Neira Ayuso wrote:
quoted
quoted
-          if (t->uports.p16.dst < t->uports.p16.src)
+          if (ntohs(t->uports.p16.dst) < ntohs(t->uports.p16.src))
Do we really need this to make sparse happy?
This looks insane to make sparse happy 

static inline u32 addr_mask(const __be32 *addr32, const __be32 *mask)
{
                return (__force u32)htonl((__force u32)(*addr32 & *mask));
}

with the "more logic"  way to write it  sparse complains on everything...

static inline u32 addr_mask(const __be32 *addr32, const __be32 *mask)
{
                return htonl(*addr32 & *mask);
}

Is there a better way to do this ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help