summaryrefslogtreecommitdiff
path: root/test/packet_inject
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-08-07 13:07:00 +0800
committerluwenpeng <[email protected]>2024-08-12 15:48:31 +0800
commitf1b3928c7093dafb553ef51f49db58659525e502 (patch)
tree9d82b6bfff6053627eed2521d0f6bfe232c44b54 /test/packet_inject
parent526171618ff2e51ac86704095cf218b6e2d86702 (diff)
🔧 build(enable cppcheck on build): eliminate cppcheck error
Diffstat (limited to 'test/packet_inject')
-rw-r--r--test/packet_inject/packet_inject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/packet_inject/packet_inject.cpp b/test/packet_inject/packet_inject.cpp
index 04e8851..3161218 100644
--- a/test/packet_inject/packet_inject.cpp
+++ b/test/packet_inject/packet_inject.cpp
@@ -377,7 +377,7 @@ static void craft_and_send_tcp_packet(struct stellar *st, struct session *sess,
else
{
tcp_seq = uint32_add(pkt_exdata->tcp_ack, pkt_exdata->inc_ack);
- tcp_ack = uint32_add(pkt_exdata->tcp_seq, pkt_exdata->tcp_payload_len + (pkt_exdata->tcp_flags & TH_SYN ? 1 : 0));
+ tcp_ack = uint32_add(pkt_exdata->tcp_seq, pkt_exdata->tcp_payload_len + ((pkt_exdata->tcp_flags & TH_SYN) ? 1 : 0));
pkt_exdata->inc_ack += tcp_payload_len;
pkt_exdata->inc_ack += (tcp_flags & TH_FIN) ? 1 : 0; // inject RST packer after FIN packer, ack should be increased by 1