]> git.baikalelectronics.ru Git - kernel.git/commit
[IPSEC]: Validate properly in xfrm_dst_check()
authorDavid S. Miller <davem@sunset.davemloft.net>
Mon, 14 Aug 2006 01:55:53 +0000 (18:55 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 14 Aug 2006 01:55:53 +0000 (18:55 -0700)
commit565a419bacbb392977c5fde03244a3929ddf9d8c
treedb35cd20d57fe5d9a7fcac5f40539902b6abbdf9
parentffb1bb873435b1a7dc1ecbdf4748910cbc4e6093
[IPSEC]: Validate properly in xfrm_dst_check()

If dst->obsolete is -1, this is a signal from the
bundle creator that we want the XFRM dst and the
dsts that it references to be validated on every
use.

I misunderstood this intention when I changed
xfrm_dst_check() to always return NULL.

Now, when we purge a dst entry, by running dst_free()
on it.  This will set the dst->obsolete to a positive
integer, and we want to return NULL in that case so
that the socket does a relookup for the route.

Thus, if dst->obsolete<0, let stale_bundle() validate
the state, else always return NULL.

In general, we need to do things more intelligently
here because we flush too much state during rule
changes.  Herbert Xu has some ideas wherein the key
manager gives us some help in this area.  We can also
use smarter state management algorithms inside of
the kernel as well.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_policy.c