From 79b872763f6018ea07503cd20132330e09f87101 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Sun, 19 Jan 2014 10:01:06 -0500
Subject: [PATCH] net-test: packetdrill: fix packet_buffer_to_string() length
 calculation

packet_buffer_to_string() needs to accont for the fact that
packet->ip_bytes does not capture the full length of the packet (in
remote mode there will be layer 2 ethernet headers as well).

Change-Id: If2c95e68071545a27078141b6ba5f98cd2c46fb9
---
 gtests/net/packetdrill/packet_to_string.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtests/net/packetdrill/packet_to_string.c b/gtests/net/packetdrill/packet_to_string.c
index fdc10dec..cfd503dc 100644
--- a/gtests/net/packetdrill/packet_to_string.c
+++ b/gtests/net/packetdrill/packet_to_string.c
@@ -45,7 +45,7 @@ static void endpoints_to_string(FILE *s, const struct packet *packet)
 static void packet_buffer_to_string(FILE *s, struct packet *packet)
 {
 	char *hex = NULL;
-	hex_dump(packet->buffer, packet->ip_bytes, &hex);
+	hex_dump(packet->buffer, packet_end(packet) - packet->buffer, &hex);
 	fputc('\n', s);
 	fprintf(s, "%s", hex);
 	free(hex);
-- 
GitLab