Skip to content
Snippets Groups Projects
Commit 79b87276 authored by Neal Cardwell's avatar Neal Cardwell
Browse files

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
parent 05737427
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ static void endpoints_to_string(FILE *s, const struct packet *packet) ...@@ -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) static void packet_buffer_to_string(FILE *s, struct packet *packet)
{ {
char *hex = NULL; char *hex = NULL;
hex_dump(packet->buffer, packet->ip_bytes, &hex); hex_dump(packet->buffer, packet_end(packet) - packet->buffer, &hex);
fputc('\n', s); fputc('\n', s);
fprintf(s, "%s", hex); fprintf(s, "%s", hex);
free(hex); free(hex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment