Store packet's ip header as unique_ptr

This commit is contained in:
Tim Wojtulewicz 2020-10-12 21:09:41 -07:00
parent 2000f89b12
commit ecd970ffde
13 changed files with 86 additions and 92 deletions

View file

@ -63,8 +63,7 @@ void Packet::Init(int arg_link_type, pkt_timeval *arg_ts, uint32_t arg_caplen,
l3_checksummed = false;
encap.reset();
delete ip_hdr;
ip_hdr = nullptr;
ip_hdr.reset();
proto = -1;
tunnel_type = BifEnum::Tunnel::IP;
@ -83,8 +82,6 @@ Packet::~Packet()
{
if ( copy )
delete [] data;
delete ip_hdr;
}
const IP_Hdr Packet::IP() const