diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 4eb4c7c76464..9b3d10e28902 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -5055,7 +5055,7 @@ key_do_getnewspi(struct sadb_spirange *spirange, struct secasindex *saidx) } if (min == max) { - if (!key_checkspidup(htonl(min))) { + if (key_checkspidup(htonl(min))) { ipseclog((LOG_DEBUG, "%s: SPI %u exists already.\n", __func__, min)); return 0;