diff --git a/src/packet_analysis/protocol/iptunnel/IPTunnel.cc b/src/packet_analysis/protocol/iptunnel/IPTunnel.cc index 9bb66e2a33..1ab225f0e9 100644 --- a/src/packet_analysis/protocol/iptunnel/IPTunnel.cc +++ b/src/packet_analysis/protocol/iptunnel/IPTunnel.cc @@ -164,11 +164,7 @@ std::unique_ptr build_inner_packet(Packet* outer_pkt, int* encap_index, uint32_t consumed_len = outer_pkt->cap_len - inner_cap_len; uint32_t inner_wire_len = outer_pkt->len - consumed_len; - pkt_timeval ts; - ts.tv_sec = static_cast(run_state::current_timestamp); - ts.tv_usec = static_cast((run_state::current_timestamp - static_cast(ts.tv_sec)) * 1000000); - - auto inner_pkt = std::make_unique(link_type, &ts, inner_cap_len, inner_wire_len, data); + auto inner_pkt = std::make_unique(link_type, &outer_pkt->ts, inner_cap_len, inner_wire_len, data); *encap_index = 0; if ( outer_pkt->session ) { diff --git a/src/packet_analysis/protocol/iptunnel/IPTunnel.h b/src/packet_analysis/protocol/iptunnel/IPTunnel.h index ea7a10a357..e1e5510311 100644 --- a/src/packet_analysis/protocol/iptunnel/IPTunnel.h +++ b/src/packet_analysis/protocol/iptunnel/IPTunnel.h @@ -77,6 +77,8 @@ protected: * The wire length (pkt->len) of the inner packet is computed based on the wire length * of the outer packet and the differences in capture lengths. * + * The inner packet's timestamp is set to the same value as the outer packet's timestamp. + * * @param outer_pkt The packet containing the encapsulation. This packet should contain * @param encap_index A return value for the current index into the encapsulation stack. * This is returned to allow analyzers to know what point in the stack they were operating