packet: properly set packet type on cloned packets

Sometimes during TCP assembly, a new packet is created
from one of the fragments, cloning its data.

The field type, used to print the Transport column was
not being properly copied from the original packet.

Fixes #378
This commit is contained in:
FIRST_NAME LAST_NAME 2021-11-11 16:37:21 +01:00
parent 4bec989cf7
commit ebc2066ff0
1 changed files with 1 additions and 0 deletions

View File

@ -56,6 +56,7 @@ packet_clone(packet_t *packet)
// Create a new packet with the original information
clone = packet_create(packet->ip_version, packet->proto, packet->src, packet->dst, packet->ip_id);
clone->tcp_seq = packet->tcp_seq;
clone->type = packet->type;
// Append this frames to the original packet
vector_iter_t frames = vector_iterator(packet->frames);