Skip to content

Commit

Permalink
Optimize seq calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
wangbin579 committed Aug 3, 2015
1 parent f075577 commit e555bae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tcpcopy/tc_packets_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ dispose_packet(unsigned char *packet, int ip_rcv_len, int *p_valid_flag)

pack_len = 0;
for (i = 0 ; i < packet_num; i++) {
tcp->seq = htonl(seq + i * max_payload);
tcp->seq = htonl(seq);
if (i != last) {
pack_len = clt_settings.mtu;
} else {
Expand All @@ -412,6 +412,8 @@ dispose_packet(unsigned char *packet, int ip_rcv_len, int *p_valid_flag)
if (replica_num > 1) {
replicate_packs((tc_iph_t *) p, (tc_tcph_t *) (p + size_ip), replica_num);
}

seq = seq + payload_len;
}
}
}
Expand Down

0 comments on commit e555bae

Please sign in to comment.