aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r--net/xfrm/xfrm_state.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 445263c54c94..535d43c14720 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -53,6 +53,7 @@ static struct hlist_head *xfrm_state_byspi __read_mostly;
53static unsigned int xfrm_state_hmask __read_mostly; 53static unsigned int xfrm_state_hmask __read_mostly;
54static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024; 54static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024;
55static unsigned int xfrm_state_num; 55static unsigned int xfrm_state_num;
56static unsigned int xfrm_state_genid;
56 57
57static inline unsigned int __xfrm4_dst_hash(xfrm_address_t *addr, unsigned int hmask) 58static inline unsigned int __xfrm4_dst_hash(xfrm_address_t *addr, unsigned int hmask)
58{ 59{
@@ -745,6 +746,8 @@ static void __xfrm_state_insert(struct xfrm_state *x)
745{ 746{
746 unsigned int h = xfrm_dst_hash(&x->id.daddr, x->props.family); 747 unsigned int h = xfrm_dst_hash(&x->id.daddr, x->props.family);
747 748
749 x->genid = ++xfrm_state_genid;
750
748 hlist_add_head(&x->bydst, xfrm_state_bydst+h); 751 hlist_add_head(&x->bydst, xfrm_state_bydst+h);
749 xfrm_state_hold(x); 752 xfrm_state_hold(x);
750 753