aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/network/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/network/packet.c')
-rw-r--r--src/charon/network/packet.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/charon/network/packet.c b/src/charon/network/packet.c
index df054c0c5..6c16a9d8d 100644
--- a/src/charon/network/packet.c
+++ b/src/charon/network/packet.c
@@ -133,39 +133,23 @@ static void destroy(private_packet_t *this)
static packet_t *clone(private_packet_t *this)
{
private_packet_t *other = (private_packet_t*)packet_create();
-
+
if (this->destination != NULL)
{
other->destination = this->destination->clone(this->destination);
}
- else
- {
- other->destination = NULL;
- }
-
if (this->source != NULL)
{
other->source = this->source->clone(this->source);
}
- else
- {
- other->source = NULL;
- }
-
- /* only clone existing chunks :-) */
if (this->data.ptr != NULL)
{
other->data.ptr = clalloc(this->data.ptr,this->data.len);
other->data.len = this->data.len;
}
- else
- {
- other->data = CHUNK_INITIALIZER;
- }
return &(other->public);
}
-
/*
* Documented in header
*/