]> git.baikalelectronics.ru Git - kernel.git/commit
cipso: Relax too much careful cipso hash function.
authorPavel Emelyanov <xemul@openvz.org>
Wed, 14 May 2008 06:23:55 +0000 (23:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 May 2008 06:23:55 +0000 (23:23 -0700)
commit72a07c5dc47261b5a64c000f7648ea349840b319
tree3e2a17bc032748e8f6ac908128e2776b3fba044a
parent075bfb8900a56593efb9dc7d767462a7b186637c
cipso: Relax too much careful cipso hash function.

The cipso_v4_cache is allocated to contain CIPSO_V4_CACHE_BUCKETS
buckets. The CIPSO_V4_CACHE_BUCKETS = 1 << CIPSO_V4_CACHE_BUCKETBITS,
where CIPSO_V4_CACHE_BUCKETBITS = 7.

The bucket-selection function for this hash is calculated like this:

  bkt = hash & (CIPSO_V4_CACHE_BUCKETBITS - 1);
                                     ^^^

i.e. picking only 4 buckets of possible 128 :)

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/cipso_ipv4.c