summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/ip_icmp.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 4b203f5..14b763e 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $Id: ip_icmp.c,v 1.7 1995/05/30 08:09:42 rgrimes Exp $
+ * $Id: ip_icmp.c,v 1.8 1995/07/10 16:16:00 wollman Exp $
*/
#include <sys/param.h>
@@ -194,10 +194,12 @@ icmp_input(m, hlen)
* that not corrupted and of at least minimum length.
*/
#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_input from %lx to %lx, len %d\n",
- ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr),
- icmplen);
+ if (icmpprintfs) {
+ char buf[4 * sizeof "123"];
+ strcpy(buf, inet_ntoa(ip->ip_src));
+ printf("icmp_input from %s to %s, len %d\n",
+ buf, inet_ntoa(ip->ip_dst), icmplen);
+ }
#endif
if (icmplen < ICMP_MINLEN) {
icmpstat.icps_tooshort++;
@@ -381,10 +383,13 @@ reflect:
icmpgw.sin_addr = ip->ip_src;
icmpdst.sin_addr = icp->icmp_gwaddr;
#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("redirect dst %lx to %lx\n",
- NTOHL(icp->icmp_ip.ip_dst.s_addr),
- NTOHL(icp->icmp_gwaddr.s_addr));
+ if (icmpprintfs) {
+ char buf[4 * sizeof "123"];
+ strcpy(buf, inet_ntoa(icp->icmp_ip.ip_dst));
+
+ printf("redirect dst %s to %s\n",
+ buf, inet_ntoa(icp->icmp_gwaddr));
+ }
#endif
icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
rtredirect((struct sockaddr *)&icmpsrc,
@@ -562,9 +567,12 @@ icmp_send(m, opts)
m->m_data -= hlen;
m->m_len += hlen;
#ifdef ICMPPRINTFS
- if (icmpprintfs)
- printf("icmp_send dst %lx src %lx\n",
- NTOHL(ip->ip_dst.s_addr), NTOHL(ip->ip_src.s_addr));
+ if (icmpprintfs) {
+ char buf[4 * sizeof "123"];
+ strcpy(buf, inet_ntoa(ip->ip_dst));
+ printf("icmp_send dst %s src %s\n",
+ buf, inet_ntoa(ip->ip_src));
+ }
#endif
(void) ip_output(m, opts, NULL, 0, NULL);
}
OpenPOWER on IntegriCloud