Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Michal Soltys <soltys@ziu.info>
To: Julien Vehent <julien@linuxwall.info>
Cc: netfilter <netfilter@vger.kernel.org>
Subject: Re: SFQ hash question
Date: Fri, 11 Sep 2009 17:12:54 +0200	[thread overview]
Message-ID: <4AAA68F6.6020804@ziu.info> (raw)
In-Reply-To: <0322d4853c39162f0819db9263a210ed@localhost>

Julien Vehent wrote:
> 
> OK for "h" and h2" before the "if", but what does this "if
> (!(iph->frag_off&htons(IP_MF|IP_OFFSET))" really does?
> 

It checks whenever the packet is not a fragment. htons(IP_MF|IP_OFFSET) 
functions as a mask which is and'ed with frag_off (which covers both fragment 
offset and "more fragments" flag).

> And, also, I'm not sure about this: "h2 ^= *(((u32*)iph) + iph->ihl);"
> 
> Does it XOR h2 with the first 32 bits of the L4 protocol header ?
> 

Yes. Excluding ESP, it basically means source and destination port (if L3's payload 
is not a fragment, thus the previous test).

Btw - if you need better control of what contributes to hash used by sfq, check out 
flow filter:

http://marc.info/?l=linux-netdev&m=120180241422360&w=2


  parent reply	other threads:[~2009-09-11 15:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 13:50 SFQ hash question Julien Vehent
2009-09-11 15:03 ` Julien Vehent
2009-09-11 15:12 ` Michal Soltys [this message]
     [not found]   ` <2643b2d5a75307da3d00e97e0245bcf9@localhost>
     [not found]     ` <4AAA70A4.8030707@ziu.info>
2009-09-11 15:53       ` Julien Vehent
2009-09-12 22:12         ` Michal Soltys

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=4AAA68F6.6020804@ziu.info \
    --to=soltys@ziu.info \
    --cc=julien@linuxwall.info \
    --cc=netfilter@vger.kernel.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