]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: avoid creating temporary SA when there are no listeners
authorHoria Geanta <horia.geanta@freescale.com>
Wed, 12 Feb 2014 14:20:06 +0000 (16:20 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 13 Feb 2014 06:40:30 +0000 (07:40 +0100)
commitbfa3eba0149bf9112418cda11219a89728e72ed2
tree31aba2926b9f641fe30e235acc5a87b1b4dab73b
parentb8388798c14a5e732a8179999454349c587ee370
xfrm: avoid creating temporary SA when there are no listeners

In the case when KMs have no listeners, km_query() will fail and
temporary SAs are garbage collected immediately after their allocation.
This causes strain on memory allocation, leading even to OOM since
temporary SA alloc/free cycle is performed for every packet
and garbage collection does not keep up the pace.

The sane thing to do is to make sure we have audience before
temporary SA allocation.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
include/net/xfrm.h
net/key/af_key.c
net/xfrm/xfrm_state.c
net/xfrm/xfrm_user.c