diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-08-24 11:23:36 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-08-24 11:23:36 +0200 |
commit | 20915d6fa774c8f5015b9f81caa442cd888ef966 (patch) | |
tree | dc564b8eef940f5ffec60f83c7d4ed425fa5ed51 /src/libcharon/network/sender.c | |
parent | 014d007000b164a15b322c3b9b6197230c3d0824 (diff) | |
download | strongswan-20915d6fa774c8f5015b9f81caa442cd888ef966.tar.bz2 strongswan-20915d6fa774c8f5015b9f81caa442cd888ef966.tar.xz |
Apply send delay before adding non-ESP marker
Otherwise the packet header could not be parsed correctly when NAT-T is
used.
Diffstat (limited to 'src/libcharon/network/sender.c')
-rw-r--r-- | src/libcharon/network/sender.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/libcharon/network/sender.c b/src/libcharon/network/sender.c index 5787b9ace..059f24b39 100644 --- a/src/libcharon/network/sender.c +++ b/src/libcharon/network/sender.c @@ -83,6 +83,22 @@ struct private_sender_t { METHOD(sender_t, send_no_marker, void, private_sender_t *this, packet_t *packet) { + this->mutex->lock(this->mutex); + this->list->insert_last(this->list, packet); + this->got->signal(this->got); + this->mutex->unlock(this->mutex); +} + +METHOD(sender_t, send_, void, + private_sender_t *this, packet_t *packet) +{ + host_t *src, *dst; + + /* if neither source nor destination port is 500 we add a Non-ESP marker */ + src = packet->get_source(packet); + dst = packet->get_destination(packet); + DBG1(DBG_NET, "sending packet: from %#H to %#H", src, dst); + if (this->send_delay) { message_t *message; @@ -104,22 +120,6 @@ METHOD(sender_t, send_no_marker, void, message->destroy(message); } - this->mutex->lock(this->mutex); - this->list->insert_last(this->list, packet); - this->got->signal(this->got); - this->mutex->unlock(this->mutex); -} - -METHOD(sender_t, send_, void, - private_sender_t *this, packet_t *packet) -{ - host_t *src, *dst; - - /* if neither source nor destination port is 500 we add a Non-ESP marker */ - src = packet->get_source(packet); - dst = packet->get_destination(packet); - DBG1(DBG_NET, "sending packet: from %#H to %#H", src, dst); - if (dst->get_port(dst) != IKEV2_UDP_PORT && src->get_port(src) != IKEV2_UDP_PORT) { |