aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/xfrm/xfrm_state.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index a35f9e4ede26..5c5f6dcab974 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -704,7 +704,8 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re
704 x->props.mode != mode || 704 x->props.mode != mode ||
705 x->props.family != family || 705 x->props.family != family ||
706 x->km.state != XFRM_STATE_ACQ || 706 x->km.state != XFRM_STATE_ACQ ||
707 x->id.spi != 0) 707 x->id.spi != 0 ||
708 x->id.proto != proto)
708 continue; 709 continue;
709 710
710 switch (family) { 711 switch (family) {
@@ -801,7 +802,8 @@ int xfrm_state_add(struct xfrm_state *x)
801 802
802 if (use_spi && x->km.seq) { 803 if (use_spi && x->km.seq) {
803 x1 = __xfrm_find_acq_byseq(x->km.seq); 804 x1 = __xfrm_find_acq_byseq(x->km.seq);
804 if (x1 && xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family)) { 805 if (x1 && ((x1->id.proto != x->id.proto) ||
806 xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) {
805 xfrm_state_put(x1); 807 xfrm_state_put(x1);
806 x1 = NULL; 808 x1 = NULL;
807 } 809 }