diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-07-13 11:13:43 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-07-13 11:13:43 +0200 |
commit | 893c3a4ead7e3fcf523b6ab83a4dd61fa7b54c9f (patch) | |
tree | 2dc792c5798c05305f1fa6a8395370f3cb277a9c /src | |
parent | be735f014887078c73343ce668c92ab4b8e56e04 (diff) | |
download | strongswan-893c3a4ead7e3fcf523b6ab83a4dd61fa7b54c9f.tar.bz2 strongswan-893c3a4ead7e3fcf523b6ab83a4dd61fa7b54c9f.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/sa/ikev2/tasks/ike_natd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcharon/sa/ikev2/tasks/ike_natd.c b/src/libcharon/sa/ikev2/tasks/ike_natd.c index 3de0ab1b4..44a2be10b 100644 --- a/src/libcharon/sa/ikev2/tasks/ike_natd.c +++ b/src/libcharon/sa/ikev2/tasks/ike_natd.c @@ -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); } |