diff options
author | Zhang Chen <zhangchen.fnst@cn.fujitsu.com> | 2017-03-02 17:54:18 +0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2017-03-06 11:46:02 +0800 |
commit | 1723a7f7cfdee92c5479aa497a6c36dec3d0ebd5 (patch) | |
tree | 2741d98c25cedc95892de7a59ef3ff38cd2fc7c9 /net | |
parent | 6efeb3286dd80c8c943f50fbb5f611d525cd6f8a (diff) |
COLO-compare: Fix icmp and udp compare different packet always dump bug
Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/colo-compare.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/net/colo-compare.c b/net/colo-compare.c index 9f5968dc0b..282727b28a 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -279,9 +279,13 @@ static int colo_packet_compare_udp(Packet *spkt, Packet *ppkt) if (ret) { trace_colo_compare_udp_miscompare("primary pkt size", ppkt->size); - qemu_hexdump((char *)ppkt->data, stderr, "colo-compare", ppkt->size); trace_colo_compare_udp_miscompare("Secondary pkt size", spkt->size); - qemu_hexdump((char *)spkt->data, stderr, "colo-compare", spkt->size); + if (trace_event_get_state(TRACE_COLO_COMPARE_MISCOMPARE)) { + qemu_hexdump((char *)ppkt->data, stderr, "colo-compare pri pkt", + ppkt->size); + qemu_hexdump((char *)spkt->data, stderr, "colo-compare sec pkt", + spkt->size); + } } return ret; @@ -311,12 +315,14 @@ static int colo_packet_compare_icmp(Packet *spkt, Packet *ppkt) network_header_length + ETH_HLEN)) { trace_colo_compare_icmp_miscompare("primary pkt size", ppkt->size); - qemu_hexdump((char *)ppkt->data, stderr, "colo-compare", - ppkt->size); trace_colo_compare_icmp_miscompare("Secondary pkt size", spkt->size); - qemu_hexdump((char *)spkt->data, stderr, "colo-compare", - spkt->size); + if (trace_event_get_state(TRACE_COLO_COMPARE_MISCOMPARE)) { + qemu_hexdump((char *)ppkt->data, stderr, "colo-compare pri pkt", + ppkt->size); + qemu_hexdump((char *)spkt->data, stderr, "colo-compare sec pkt", + spkt->size); + } return -1; } else { return 0; |