Add Non-ESP marker in sender and not individual socket plugins.

This commit is contained in:
Tobias Brunner
2012-08-08 15:12:24 +02:00
parent 65da43e2fc
commit 064da8b96b
5 changed files with 23 additions and 39 deletions
@@ -315,7 +315,7 @@ METHOD(socket_t, sender, status_t,
{
int sport, skt, family;
ssize_t bytes_sent;
chunk_t data, marked;
chunk_t data;
host_t *src, *dst;
struct msghdr msg;
struct cmsghdr *cmsg;
@@ -351,17 +351,6 @@ METHOD(socket_t, sender, status_t,
{
skt = this->ipv6_natt;
}
/* NAT keepalives without marker */
if (data.len != 1 || data.ptr[0] != 0xFF)
{
/* add non esp marker to packet */
marked = chunk_alloc(data.len + MARKER_LEN);
memset(marked.ptr, 0, MARKER_LEN);
memcpy(marked.ptr + MARKER_LEN, data.ptr, data.len);
/* let the packet do the clean up for us */
packet->set_data(packet, marked);
data = marked;
}
}
else
{