bugfix: build packet also copy metadata from original packet

This commit is contained in:
luwenpeng
2024-10-24 11:00:20 +08:00
parent 1e71122521
commit cb6f231935
2 changed files with 8 additions and 6 deletions

View File

@@ -303,6 +303,7 @@ struct packet *packet_build_tcp(const struct packet *origin_pkt, uint32_t tcp_se
.args = NULL,
.thr_idx = -1,
};
memcpy(&new_pkt->meta, &origin_pkt->meta, sizeof(struct metadata));
packet_set_origin(new_pkt, &origin);
return new_pkt;
@@ -352,6 +353,7 @@ struct packet *packet_build_udp(const struct packet *origin_pkt, const char *udp
.args = NULL,
.thr_idx = -1,
};
memcpy(&new_pkt->meta, &origin_pkt->meta, sizeof(struct metadata));
packet_set_origin(new_pkt, &origin);
return new_pkt;
@@ -428,6 +430,7 @@ struct packet *packet_build_l3(const struct packet *origin_pkt, uint8_t ip_proto
.args = NULL,
.thr_idx = -1,
};
memcpy(&new_pkt->meta, &origin_pkt->meta, sizeof(struct metadata));
packet_set_origin(new_pkt, &origin);
return new_pkt;