inject TCP RST test pass

This commit is contained in:
luwenpeng
2024-05-08 18:24:26 +08:00
parent 61ee619689
commit 37d12ebcfc
16 changed files with 766 additions and 206 deletions

View File

@@ -290,7 +290,7 @@ int dumpfile_io_ingress(struct dumpfile_io *handle, uint16_t thr_idx, struct pac
pkt = &pkts[nr_parsed];
memset(pkt, 0, sizeof(struct packet));
packet_parse(pkt, pcap_pkt->data, pcap_pkt->len);
packet_set_io_ctx(pkt, pcap_pkt);
packet_set_origin_ctx(pkt, pcap_pkt);
packet_set_origin(pkt, PACKET_ORIGIN_DUMPFILE);
nr_parsed++;
}
@@ -316,7 +316,7 @@ void dumpfile_io_egress(struct dumpfile_io *handle, uint16_t thr_idx, struct pac
stat->raw_tx_pkts++;
stat->raw_tx_bytes += len;
struct pcap_pkt *pcap_pkt = (struct pcap_pkt *)packet_get_io_ctx(pkt);
struct pcap_pkt *pcap_pkt = (struct pcap_pkt *)packet_get_origin_ctx(pkt);
if (pcap_pkt)
{
free(pcap_pkt);
@@ -333,7 +333,7 @@ void dumpfile_io_drop(struct dumpfile_io *handle, uint16_t thr_idx, struct packe
for (int i = 0; i < nr_pkts; i++)
{
pkt = &pkts[i];
struct pcap_pkt *pcap_pkt = (struct pcap_pkt *)packet_get_io_ctx(pkt);
struct pcap_pkt *pcap_pkt = (struct pcap_pkt *)packet_get_origin_ctx(pkt);
if (pcap_pkt)
{
stat->drop_pkts++;