aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/xfrm/xfrm_state.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index fafe1ed5f56b..f927b7330f02 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -96,9 +96,12 @@ static void xfrm_hash_transfer(struct hlist_head *list,
96 nhashmask); 96 nhashmask);
97 hlist_add_head(&x->bysrc, nsrctable+h); 97 hlist_add_head(&x->bysrc, nsrctable+h);
98 98
99 h = __xfrm_spi_hash(&x->id.daddr, x->id.spi, x->id.proto, 99 if (x->id.spi) {
100 x->props.family, nhashmask); 100 h = __xfrm_spi_hash(&x->id.daddr, x->id.spi,
101 hlist_add_head(&x->byspi, nspitable+h); 101 x->id.proto, x->props.family,
102 nhashmask);
103 hlist_add_head(&x->byspi, nspitable+h);
104 }
102 } 105 }
103} 106}
104 107
@@ -622,7 +625,7 @@ static void __xfrm_state_insert(struct xfrm_state *x)
622 h = xfrm_src_hash(&x->props.saddr, x->props.family); 625 h = xfrm_src_hash(&x->props.saddr, x->props.family);
623 hlist_add_head(&x->bysrc, xfrm_state_bysrc+h); 626 hlist_add_head(&x->bysrc, xfrm_state_bysrc+h);
624 627
625 if (xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY)) { 628 if (x->id.spi) {
626 h = xfrm_spi_hash(&x->id.daddr, x->id.spi, x->id.proto, 629 h = xfrm_spi_hash(&x->id.daddr, x->id.spi, x->id.proto,
627 x->props.family); 630 x->props.family);
628 631