Skip to content

Commit e555bae

Browse files
committed
Optimize seq calculations
1 parent f075577 commit e555bae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tcpcopy/tc_packets_module.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ dispose_packet(unsigned char *packet, int ip_rcv_len, int *p_valid_flag)
393393

394394
pack_len = 0;
395395
for (i = 0 ; i < packet_num; i++) {
396-
tcp->seq = htonl(seq + i * max_payload);
396+
tcp->seq = htonl(seq);
397397
if (i != last) {
398398
pack_len = clt_settings.mtu;
399399
} else {
@@ -412,6 +412,8 @@ dispose_packet(unsigned char *packet, int ip_rcv_len, int *p_valid_flag)
412412
if (replica_num > 1) {
413413
replicate_packs((tc_iph_t *) p, (tc_tcph_t *) (p + size_ip), replica_num);
414414
}
415+
416+
seq = seq + payload_len;
415417
}
416418
}
417419
}

0 commit comments

Comments
 (0)