Skip to content

Commit 5a2d992

Browse files
raolei-inteljasowang
authored andcommitted
Fixed calculation error of pkt->header_size in fill_pkt_tcp_info()
The data pointer has skipped vnet_hdr_len in the function of parse_packet_early().So, we can not subtract vnet_hdr_len again when calculating pkt->header_size in fill_pkt_tcp_info(). Otherwise, it will cause network packet comparsion errors and greatly increase the frequency of checkpoints. Signed-off-by: Lei Rao <[email protected]> Signed-off-by: Zhang Chen <[email protected]> Reviewed-by: Li Zhijian <[email protected]> Reviewed-by: Zhang Chen <[email protected]> Reviewed-by: Lukas Straub <[email protected]> Tested-by: Lukas Straub <[email protected]> Signed-off-by: Jason Wang <[email protected]>
1 parent 0c7af1a commit 5a2d992

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/colo-compare.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static void fill_pkt_tcp_info(void *data, uint32_t *max_ack)
211211
pkt->tcp_ack = ntohl(tcphd->th_ack);
212212
*max_ack = *max_ack > pkt->tcp_ack ? *max_ack : pkt->tcp_ack;
213213
pkt->header_size = pkt->transport_header - (uint8_t *)pkt->data
214-
+ (tcphd->th_off << 2) - pkt->vnet_hdr_len;
214+
+ (tcphd->th_off << 2);
215215
pkt->payload_size = pkt->size - pkt->header_size;
216216
pkt->seq_end = pkt->tcp_seq + pkt->payload_size;
217217
pkt->flags = tcphd->th_flags;

0 commit comments

Comments
 (0)