diff options
| author | luwenpeng <[email protected]> | 2024-10-24 11:00:20 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2024-10-23 17:11:01 +0800 |
| commit | cb6f2319352b65001db13c32b879d847abf0d90f (patch) | |
| tree | 65eeb9622c878032b98e839be6c2266b8f55446d /infra/packet_manager | |
| parent | 1e71122521ec8bdb327d7e739b6870d4ea2c1e54 (diff) | |
bugfix: build packet also copy metadata from original packet
Diffstat (limited to 'infra/packet_manager')
| -rw-r--r-- | infra/packet_manager/packet_builder.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/infra/packet_manager/packet_builder.c b/infra/packet_manager/packet_builder.c index 872e65b..8114412 100644 --- a/infra/packet_manager/packet_builder.c +++ b/infra/packet_manager/packet_builder.c @@ -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; |
