mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-09 00:00:53 -04:00
ikev1: Be more verbose if a peer config would match, but is unusable for Mode
This commit is contained in:
parent
9e3ab0d114
commit
55e85387bb
@ -536,6 +536,7 @@ METHOD(phase1_t, select_config, peer_cfg_t*,
|
|||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
peer_cfg_t *current;
|
peer_cfg_t *current;
|
||||||
host_t *me, *other;
|
host_t *me, *other;
|
||||||
|
int unusable = 0;
|
||||||
|
|
||||||
if (this->peer_cfg)
|
if (this->peer_cfg)
|
||||||
{ /* try to find an alternative config */
|
{ /* try to find an alternative config */
|
||||||
@ -571,6 +572,10 @@ METHOD(phase1_t, select_config, peer_cfg_t*,
|
|||||||
this->candidates->insert_last(this->candidates, current);
|
this->candidates->insert_last(this->candidates, current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unusable++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
|
|
||||||
@ -580,6 +585,13 @@ METHOD(phase1_t, select_config, peer_cfg_t*,
|
|||||||
this->peer_cfg->get_name(this->peer_cfg));
|
this->peer_cfg->get_name(this->peer_cfg));
|
||||||
return this->peer_cfg->get_ref(this->peer_cfg);
|
return this->peer_cfg->get_ref(this->peer_cfg);
|
||||||
}
|
}
|
||||||
|
if (unusable)
|
||||||
|
{
|
||||||
|
DBG1(DBG_IKE, "found %d matching config%s, but none allows %N "
|
||||||
|
"authentication using %s Mode", unusable, unusable > 1 ? "s" : "",
|
||||||
|
auth_method_names, method, aggressive ? "Aggressive" : "Main");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
DBG1(DBG_IKE, "no peer config found");
|
DBG1(DBG_IKE, "no peer config found");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user