Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jan Engelhardt <jengelh@inai.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	Hans Schillstrom <hans.schillstrom@ericsson.com>,
	kaber@trash.net, jengelh@medozas.de,
	netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
	dan.carpenter@oracle.com, hans@schillstrom.com
Subject: Re: [PATCH] netfilter: xt_HMARK: endian bugs
Date: Mon, 14 May 2012 17:24:39 +0200	[thread overview]
Message-ID: <1337009079.8512.535.camel@edumazet-glaptop> (raw)
In-Reply-To: <alpine.LNX.2.01.1205141702110.11548@frira.vanv.qr>

On Mon, 2012-05-14 at 17:05 +0200, Jan Engelhardt wrote:
> On Monday 2012-05-14 16:40, Pablo Neira Ayuso wrote:
> 
> >> -		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(...)





  reply	other threads:[~2012-05-14 15:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 13:42 [PATCH] netfilter: xt_HMARK: endian bugs Hans Schillstrom
2012-05-14 14:40 ` Pablo Neira Ayuso
2012-05-14 15:05   ` Hans Schillstrom
2012-05-14 15:05   ` Jan Engelhardt
2012-05-14 15:24     ` Eric Dumazet [this message]
2012-05-14 16:09       ` Hans Schillstrom
2012-05-14 16:24         ` Eric Dumazet
2012-05-14 17:51           ` Hans Schillstrom
2012-05-14 18:24             ` Jan Engelhardt
2012-05-14 18:28             ` Eric Dumazet
2012-05-14 18:35             ` Jozsef Kadlecsik
2012-05-14 19:02               ` Pablo Neira Ayuso
2012-05-14 19:13                 ` Eric Dumazet
2012-05-15  5:57                   ` Hans Schillström
2012-05-15  7:33       ` Hans Schillström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337009079.8512.535.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hans.schillstrom@ericsson.com \
    --cc=hans@schillstrom.com \
    --cc=jengelh@inai.de \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox