Use send_no_marker to send NAT keepalives.
authorTobias Brunner <tobias@strongswan.org>
Fri, 24 Feb 2012 12:09:09 +0000 (13:09 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 Aug 2012 13:12:25 +0000 (15:12 +0200)
src/libcharon/network/sender.c
src/libcharon/sa/ike_sa.c

index b3e8d29..a919a02 100644 (file)
@@ -127,15 +127,10 @@ METHOD(sender_t, send_, void,
        if (dst->get_port(dst) != IKEV2_UDP_PORT &&
                src->get_port(src) != IKEV2_UDP_PORT)
        {
-               chunk_t marker = chunk_from_chars(0x00, 0x00, 0x00, 0x00), data;
+               chunk_t data, marker = chunk_from_chars(0x00, 0x00, 0x00, 0x00);
 
-               data = packet->get_data(packet);
-               /* NAT keepalives have no marker prepended */
-               if (data.len != 1 || data.ptr[0] != 0xFF)
-               {
-                       data = chunk_cat("cc", marker, data);
-                       packet->set_data(packet, data);
-               }
+               data = chunk_cat("cc", marker, packet->get_data(packet));
+               packet->set_data(packet, data);
        }
 
        send_no_marker(this, packet);
index 5182da5..755e5d7 100644 (file)
@@ -489,7 +489,7 @@ METHOD(ike_sa_t, send_keepalive, void,
                data.len = 1;
                packet->set_data(packet, data);
                DBG1(DBG_IKE, "sending keep alive");
-               charon->sender->send(charon->sender, packet);
+               charon->sender->send_no_marker(charon->sender, packet);
                diff = 0;
        }
        job = send_keepalive_job_create(this->ike_sa_id);