enhance: imitate_tcp_packet() support setting tcp options

This commit is contained in:
luwenpeng
2024-07-02 17:55:55 +08:00
parent 5591227b9a
commit 2c0ec4072f
8 changed files with 73 additions and 16 deletions

View File

@@ -388,7 +388,7 @@ static void imitate_and_send_tcp_packet(struct stellar *st, struct session *sess
return;
}
struct packet *imitate_pkt = imitate_tcp_packet(origin_pkt, tcp_seq, tcp_ack, tcp_flags, tcp_payload, tcp_payload_len);
struct packet *imitate_pkt = imitate_tcp_packet(origin_pkt, tcp_seq, tcp_ack, tcp_flags, NULL, 0, tcp_payload, tcp_payload_len);
if (imitate_pkt == NULL)
{
LOG_ERR("imitate TCP packet failed\n");

View File

@@ -288,7 +288,7 @@ static void craft_compare(const struct runtime *rte, const struct packet *raw_pk
error_out:
char file[256] = {0};
snprintf(file, sizeof(file), "craft%lu.pcap", rte->pcap_count);
packet_dump(file, new_pkt_data, new_pkt_len);
packet_dump_pcap(new_pkt, file);
packet_free(new_pkt);
}