]> err.no Git - linux-2.6/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)
commit5e0f8923f350ff522f8f6aecf198df045af3615f
tree3e2a17bc032748e8f6ac908128e2776b3fba044a
parent79d44516b4b178ffb6e2159c75584cfcfc097914
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