Simplify NAT-D payload creation if UDP encapsulation is forced

We don't need any address lookups in that case as the content of the
payload is generated randomly anyway.
This commit is contained in:
Tobias Brunner
2012-07-13 11:13:43 +02:00
parent be735f0148
commit 893c3a4ead
+2 -2
View File
@@ -306,8 +306,8 @@ METHOD(task_t, build_i, status_t,
* 3. Include all possbile addresses
*/
host = message->get_source(message);
if (!host->is_anyaddr(host))
{ /* 1. */
if (!host->is_anyaddr(host) || ike_cfg->force_encap(ike_cfg))
{ /* 1. or if we force UDP encap, as it doesn't matter if it's %any */
notify = build_natd_payload(this, NAT_DETECTION_SOURCE_IP, host);
message->add_payload(message, (payload_t*)notify);
}