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)
This commit is contained in:
parent
6c40add10d
commit
ff49597ed1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28059
@ -45,7 +45,7 @@ static const char copyright[] =
|
|||||||
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
|
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
|
||||||
*/
|
*/
|
||||||
static const char rcsid[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -992,7 +992,7 @@ pr_icmph(icp)
|
|||||||
break;
|
break;
|
||||||
case ICMP_UNREACH_NEEDFRAG:
|
case ICMP_UNREACH_NEEDFRAG:
|
||||||
(void)printf("frag needed and DF set (MTU %d)\n",
|
(void)printf("frag needed and DF set (MTU %d)\n",
|
||||||
icp->icmp_nextmtu);
|
ntohs(icp->icmp_nextmtu));
|
||||||
break;
|
break;
|
||||||
case ICMP_UNREACH_SRCFAIL:
|
case ICMP_UNREACH_SRCFAIL:
|
||||||
(void)printf("Source Route Failed\n");
|
(void)printf("Source Route Failed\n");
|
||||||
@ -1038,7 +1038,7 @@ pr_icmph(icp)
|
|||||||
(void)printf("Redirect, Bad Code: %d", icp->icmp_code);
|
(void)printf("Redirect, Bad Code: %d", icp->icmp_code);
|
||||||
break;
|
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
|
#ifndef icmp_data
|
||||||
pr_retip(&icp->icmp_ip);
|
pr_retip(&icp->icmp_ip);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user