aboutsummaryrefslogtreecommitdiff
path: root/net/colo-compare.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/colo-compare.c')
-rw-r--r--net/colo-compare.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 109990fd8e..f791383dbc 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -188,7 +188,6 @@ static int colo_packet_compare_tcp(Packet *spkt, Packet *ppkt)
{
struct tcphdr *ptcp, *stcp;
int res;
- char *sdebug, *ddebug;
trace_colo_compare_main("compare tcp");
if (ppkt->size != spkt->size) {
@@ -219,24 +218,21 @@ static int colo_packet_compare_tcp(Packet *spkt, Packet *ppkt)
(spkt->size - ETH_HLEN));
if (res != 0 && trace_event_get_state(TRACE_COLO_COMPARE_MISCOMPARE)) {
- sdebug = strdup(inet_ntoa(ppkt->ip->ip_src));
- ddebug = strdup(inet_ntoa(ppkt->ip->ip_dst));
- fprintf(stderr, "%s: src/dst: %s/%s p: seq/ack=%u/%u"
- " s: seq/ack=%u/%u res=%d flags=%x/%x\n",
- __func__, sdebug, ddebug,
- (unsigned int)ntohl(ptcp->th_seq),
- (unsigned int)ntohl(ptcp->th_ack),
- (unsigned int)ntohl(stcp->th_seq),
- (unsigned int)ntohl(stcp->th_ack),
- res, ptcp->th_flags, stcp->th_flags);
-
- fprintf(stderr, "Primary len = %d\n", ppkt->size);
- qemu_hexdump((char *)ppkt->data, stderr, "colo-compare", ppkt->size);
- fprintf(stderr, "Secondary len = %d\n", spkt->size);
- qemu_hexdump((char *)spkt->data, stderr, "colo-compare", spkt->size);
-
- g_free(sdebug);
- g_free(ddebug);
+ trace_colo_compare_pkt_info(inet_ntoa(ppkt->ip->ip_src),
+ inet_ntoa(ppkt->ip->ip_dst),
+ ntohl(ptcp->th_seq),
+ ntohl(ptcp->th_ack),
+ ntohl(stcp->th_seq),
+ ntohl(stcp->th_ack),
+ res, ptcp->th_flags,
+ stcp->th_flags,
+ ppkt->size,
+ spkt->size);
+
+ qemu_hexdump((char *)ppkt->data, stderr,
+ "colo-compare ppkt", ppkt->size);
+ qemu_hexdump((char *)spkt->data, stderr,
+ "colo-compare spkt", spkt->size);
}
return res;