[IPSEC]: Policy list disorder
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 17 Jan 2007 00:52:02 +0000 (16:52 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 24 Jan 2007 04:25:51 +0000 (20:25 -0800)
commita6c7ab55dda3e16ab5a3cf6f39585aee5876ac3a
tree2ad7ed20bcf18bf1ff8b9354ec0a8f498627c1eb
parent8f1adb5f27d352c776ac34648cc277d1f8199dba
[IPSEC]: Policy list disorder

The recent hashing introduced an off-by-one bug in policy list insertion.
Instead of adding after the last entry with a lesser or equal priority,
we're adding after the successor of that entry.

This patch fixes this and also adds a warning if we detect a duplicate
entry in the policy list.  This should never happen due to this if clause.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_policy.c