Avoid unnecessary copy of packet data when removing Non-ESP marker.
authorTobias Brunner <tobias@strongswan.org>
Fri, 24 Feb 2012 10:44:05 +0000 (11:44 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 Aug 2012 13:12:25 +0000 (15:12 +0200)
src/libcharon/network/receiver.c

index 8240c2a..3a52f8d 100644 (file)
@@ -453,8 +453,7 @@ static job_requeue_t receive_packets(private_receiver_t *this)
        {
                if (memeq(data.ptr, marker.ptr, marker.len))
                {       /* remove Non-ESP marker */
        {
                if (memeq(data.ptr, marker.ptr, marker.len))
                {       /* remove Non-ESP marker */
-                       data = chunk_skip(data, marker.len);
-                       packet->set_data(packet, chunk_clone(data));
+                       packet->skip_bytes(packet, marker.len);
                }
                else
                {       /* this seems to be an ESP packet */
                }
                else
                {       /* this seems to be an ESP packet */