xfrm: Do not hash socket policies
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 13 Nov 2014 09:09:49 +0000 (17:09 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 13 Nov 2014 10:25:03 +0000 (11:25 +0100)
commit53c2e285f9703001e1bb48d04696c5f9d8f3aef7
treedce531b10da3a88562a15986ff85cc986bbf73e3
parentf293a5e33e084ef84b802e3002e5fe3eef086171
xfrm: Do not hash socket policies

Back in 2003 when I added policy expiration, I half-heartedly
did a clean-up and renamed xfrm_sk_policy_link/xfrm_sk_policy_unlink
to __xfrm_policy_link/__xfrm_policy_unlink, because the latter
could be reused for all policies.  I never actually got around
to using __xfrm_policy_link for non-socket policies.

Later on hashing was added to all xfrm policies, including socket
policies.  In fact, we don't need hashing on socket policies at
all since they're always looked up via a linked list.

This patch restores xfrm_sk_policy_link/xfrm_sk_policy_unlink
as wrappers around __xfrm_policy_link/__xfrm_policy_unlink so
that it's obvious we're dealing with socket policies.

This patch also removes hashing from __xfrm_policy_link as for
now it's only used by socket policies which do not need to be
hashed.  Ironically this will in fact allow us to use this helper
for non-socket policies which I shall do later.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
include/net/netns/xfrm.h
net/xfrm/xfrm_policy.c