summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>1997-08-11 04:33:07 +0000
committerfenner <fenner@FreeBSD.org>1997-08-11 04:33:07 +0000
commit5555a73810e96888231ea397c55ee788055ab6c7 (patch)
tree07c489d6ba6276bf28460df878569c89b037270c
parentc8b8aa249ff124a8f6653b53c4d9909c495570e7 (diff)
downloadFreeBSD-src-5555a73810e96888231ea397c55ee788055ab6c7.zip
FreeBSD-src-5555a73810e96888231ea397c55ee788055ab6c7.tar.gz
Add an ntohs() and format an IP address with inet_ntoa() when
printing the details of a received ICMP packet. PR: bin/3766 Submitted by: denny1@home.com (Denton Gentry)
-rw-r--r--sbin/ping/ping.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index ffab825..a5b9e0e 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
*/
static const char rcsid[] =
- "$Id: ping.c,v 1.26 1997/07/20 06:09:55 bde Exp $";
+ "$Id: ping.c,v 1.27 1997/08/07 02:41:15 julian Exp $";
#endif /* not lint */
/*
@@ -992,7 +992,7 @@ pr_icmph(icp)
break;
case ICMP_UNREACH_NEEDFRAG:
(void)printf("frag needed and DF set (MTU %d)\n",
- icp->icmp_nextmtu);
+ ntohs(icp->icmp_nextmtu));
break;
case ICMP_UNREACH_SRCFAIL:
(void)printf("Source Route Failed\n");
@@ -1038,7 +1038,7 @@ pr_icmph(icp)
(void)printf("Redirect, Bad Code: %d", icp->icmp_code);
break;
}
- (void)printf("(New addr: 0x%08lx)\n", icp->icmp_gwaddr.s_addr);
+ (void)printf("(New addr: %s)\n", inet_ntoa(icp->icmp_gwaddr));
#ifndef icmp_data
pr_retip(&icp->icmp_ip);
#else
OpenPOWER on IntegriCloud