ikev1: Always send ID payloads (traffic selectors) during Quick Mode
authorTobias Brunner <tobias@strongswan.org>
Thu, 25 Jul 2013 15:08:17 +0000 (17:08 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 25 Jul 2013 15:08:17 +0000 (17:08 +0200)
Especially Windows 7 has problems if the peer does not send ID payloads
for host-to-host connections (tunnel and transport mode).

Fixes #319.

src/libcharon/sa/ikev1/tasks/quick_mode.c

index 92df0f0..6271e5b 100644 (file)
@@ -510,33 +510,11 @@ static traffic_selector_t* select_ts(private_quick_mode_t *this, bool local,
 static void add_ts(private_quick_mode_t *this, message_t *message)
 {
        id_payload_t *id_payload;
-       host_t *hsi, *hsr;
 
-       if (this->initiator)
-       {
-               hsi = this->ike_sa->get_my_host(this->ike_sa);
-               hsr = this->ike_sa->get_other_host(this->ike_sa);
-       }
-       else
-       {
-               hsr = this->ike_sa->get_my_host(this->ike_sa);
-               hsi = this->ike_sa->get_other_host(this->ike_sa);
-       }
-       /* add ID payload only if negotiating non host2host tunnels */
-       if (!this->tsi->is_host(this->tsi, hsi) ||
-               !this->tsr->is_host(this->tsr, hsr) ||
-               this->tsi->get_protocol(this->tsi) ||
-               this->tsr->get_protocol(this->tsr) ||
-               this->tsi->get_from_port(this->tsi) ||
-               this->tsr->get_from_port(this->tsr) ||
-               this->tsi->get_to_port(this->tsi) != 65535 ||
-               this->tsr->get_to_port(this->tsr) != 65535)
-       {
-               id_payload = id_payload_create_from_ts(this->tsi);
-               message->add_payload(message, &id_payload->payload_interface);
-               id_payload = id_payload_create_from_ts(this->tsr);
-               message->add_payload(message, &id_payload->payload_interface);
-       }
+       id_payload = id_payload_create_from_ts(this->tsi);
+       message->add_payload(message, &id_payload->payload_interface);
+       id_payload = id_payload_create_from_ts(this->tsr);
+       message->add_payload(message, &id_payload->payload_interface);
 }
 
 /**