diff options
-rw-r--r-- | networking/traceroute.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c index 4d0ebc3b7..8ab4caefe 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -608,7 +608,7 @@ hexdump(const struct icmp *icp, int len) | |||
608 | const unsigned char *p; | 608 | const unsigned char *p; |
609 | int i; | 609 | int i; |
610 | 610 | ||
611 | printf("\n%d bytes from %s to %s: icmp type %d (%s) code %d\n", | 611 | printf("\n%d bytes from %s to %s: icmp type %u (%s) code %u\n", |
612 | len, | 612 | len, |
613 | auto_string(xmalloc_sockaddr2dotted_noport(&G.from_lsa->u.sa)), | 613 | auto_string(xmalloc_sockaddr2dotted_noport(&G.from_lsa->u.sa)), |
614 | auto_string(xmalloc_sockaddr2dotted_noport(G.to)), | 614 | auto_string(xmalloc_sockaddr2dotted_noport(G.to)), |
@@ -617,13 +617,9 @@ hexdump(const struct icmp *icp, int len) | |||
617 | ); | 617 | ); |
618 | p = (const void *)icp; | 618 | p = (const void *)icp; |
619 | for (i = 0; i < len; i++) { | 619 | for (i = 0; i < len; i++) { |
620 | if (i % 16 == 0) | 620 | if (!(i & 0xf)) |
621 | printf("%04x:", i); | 621 | printf("\n%04x:" + (i==0), i); |
622 | if (i % 4 == 0) | 622 | printf(" %02x", p[i]); |
623 | bb_putchar(' '); | ||
624 | printf("%02x", p[i]); | ||
625 | if ((i % 16 == 15) && (i + 1 < len)) | ||
626 | bb_putchar('\n'); | ||
627 | } | 623 | } |
628 | bb_putchar('\n'); | 624 | bb_putchar('\n'); |
629 | } | 625 | } |
@@ -706,7 +702,7 @@ packet4_ok(int read_len, int seq) | |||
706 | } | 702 | } |
707 | } | 703 | } |
708 | } | 704 | } |
709 | if (verbose) | 705 | if (verbose) /* testcase: traceroute -vI 127.0.0.1 (sees its own echo requests) */ |
710 | hexdump(icp, read_len); | 706 | hexdump(icp, read_len); |
711 | return 0; | 707 | return 0; |
712 | } | 708 | } |