From 6928709886a1872fc91864e531aada1252c57c24 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 4 Sep 2024 15:08:47 +0200 Subject: [PATCH] ike-cfg: Only consider port information if the IP matches Otherwise, all configs would be considered to even some degree as the ports usually match. Closes strongswan/strongswan#2441 Fixes: 9228a5109b8d ("ike-cfg: Consider port information in IKE config match") --- src/libcharon/config/ike_cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcharon/config/ike_cfg.c b/src/libcharon/config/ike_cfg.c index 07e224c01..5d73157b0 100644 --- a/src/libcharon/config/ike_cfg.c +++ b/src/libcharon/config/ike_cfg.c @@ -259,7 +259,7 @@ static u_int match(linked_list_t *hosts, linked_list_t *ranges, uint16_t port, enumerator->destroy(enumerator); /* honor if port matches exactly */ - if (port == cand->get_port(cand)) + if (quality && port == cand->get_port(cand)) { quality += 1; }