Use send_no_marker to send NAT keepalives.

This commit is contained in:
Tobias Brunner 2012-02-24 13:09:09 +01:00
parent 30dc7dff4d
commit 75f8316332
2 changed files with 4 additions and 9 deletions

View 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);

View 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);