Re: SFQ hash question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux