Loading net/colo-compare.c +6 −2 Original line number Diff line number Diff line Loading @@ -201,8 +201,11 @@ static int colo_packet_compare_common(Packet *ppkt, Packet *spkt, int offset) sec_ip_src, sec_ip_dst); } offset = ppkt->vnet_hdr_len + offset; if (ppkt->size == spkt->size) { return memcmp(ppkt->data + offset, spkt->data + offset, return memcmp(ppkt->data + offset, spkt->data + offset, spkt->size - offset); } else { trace_colo_compare_main("Net packet size are not the same"); Loading Loading @@ -261,8 +264,9 @@ static int colo_packet_compare_tcp(Packet *spkt, Packet *ppkt) */ if (ptcp->th_off > 5) { ptrdiff_t tcp_offset; tcp_offset = ppkt->transport_header - (uint8_t *)ppkt->data + (ptcp->th_off * 4); + (ptcp->th_off * 4) - ppkt->vnet_hdr_len; res = colo_packet_compare_common(ppkt, spkt, tcp_offset); } else if (ptcp->th_sum == stcp->th_sum) { res = colo_packet_compare_common(ppkt, spkt, ETH_HLEN); Loading Loading
net/colo-compare.c +6 −2 Original line number Diff line number Diff line Loading @@ -201,8 +201,11 @@ static int colo_packet_compare_common(Packet *ppkt, Packet *spkt, int offset) sec_ip_src, sec_ip_dst); } offset = ppkt->vnet_hdr_len + offset; if (ppkt->size == spkt->size) { return memcmp(ppkt->data + offset, spkt->data + offset, return memcmp(ppkt->data + offset, spkt->data + offset, spkt->size - offset); } else { trace_colo_compare_main("Net packet size are not the same"); Loading Loading @@ -261,8 +264,9 @@ static int colo_packet_compare_tcp(Packet *spkt, Packet *ppkt) */ if (ptcp->th_off > 5) { ptrdiff_t tcp_offset; tcp_offset = ppkt->transport_header - (uint8_t *)ppkt->data + (ptcp->th_off * 4); + (ptcp->th_off * 4) - ppkt->vnet_hdr_len; res = colo_packet_compare_common(ppkt, spkt, tcp_offset); } else if (ptcp->th_sum == stcp->th_sum) { res = colo_packet_compare_common(ppkt, spkt, ETH_HLEN); Loading