aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2013-04-14 19:57:49 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-04-14 19:57:49 +0200
commit654c88bca8e268e7cd86483388439f033c68574f (patch)
treea5df129e835c55286443caee947a5ccf16f6f93f /src
parentcf1696cab9b51cffc0b51ec6d582c059d697183b (diff)
downloadstrongswan-654c88bca8e268e7cd86483388439f033c68574f.tar.bz2
strongswan-654c88bca8e268e7cd86483388439f033c68574f.tar.xz
Added charon.initiator_only option which causes charon to ignore IKE initiation requests by peers
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/network/receiver.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libcharon/network/receiver.c b/src/libcharon/network/receiver.c
index 6b2c2bf5b..2ca721a85 100644
--- a/src/libcharon/network/receiver.c
+++ b/src/libcharon/network/receiver.c
@@ -148,6 +148,12 @@ struct private_receiver_t {
* Delay response messages?
*/
bool receive_delay_response;
+
+ /**
+ * Endpoint is allowed to act as an initiator only
+ */
+ bool initiator_only;
+
};
/**
@@ -541,7 +547,7 @@ static job_requeue_t receive_packets(private_receiver_t *this)
if (message->get_request(message) &&
message->get_exchange_type(message) == IKE_SA_INIT)
{
- if (drop_ike_sa_init(this, message))
+ if (this->initiator_only || drop_ike_sa_init(this, message))
{
message->destroy(message);
return JOB_REQUEUE_DIRECT;
@@ -552,7 +558,7 @@ static job_requeue_t receive_packets(private_receiver_t *this)
{
id = message->get_ike_sa_id(message);
if (id->get_responder_spi(id) == 0 &&
- drop_ike_sa_init(this, message))
+ (this->initiator_only || drop_ike_sa_init(this, message)))
{
message->destroy(message);
return JOB_REQUEUE_DIRECT;
@@ -650,6 +656,8 @@ receiver_t *receiver_create()
"%s.receive_delay_request", TRUE, charon->name),
this->receive_delay_response = lib->settings->get_bool(lib->settings,
"%s.receive_delay_response", TRUE, charon->name),
+ this->initiator_only = lib->settings->get_bool(lib->settings,
+ "%s.initiator_only", FALSE, charon->name),
this->hasher = lib->crypto->create_hasher(lib->crypto, HASH_PREFERRED);
if (!this->hasher)