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

Re: [PATCH] netfilter: xt_HMARK: endian bugs

From: Eric Dumazet <hidden>
Date: 2012-05-14 15:24:39
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?
You need it to make *maths* happy.

Consider

	384 < 65407

but

	    ntohs(384) > ntohs(65407)
	<=> 32769 > 32767
--
Doesnt matter at all in this context.

Take a look at 

void __skb_get_rxhash(struct sk_buff *skb)

if ((__force u16)keys.port16[1] < (__force u16)keys.port16[0])
	swap(...)



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help