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: 9228a5109b ("ike-cfg: Consider port information in IKE config match")
This commit is contained in:
Tobias Brunner
2024-09-05 10:22:25 +02:00
parent 12d2b6e2b4
commit 6928709886
+1 -1
View File
@@ -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;
}