Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet make ICMPPRINTFS work; from Liam Foy.



details:   https://anonhg.NetBSD.org/src/rev/7e24c4c0ec53
branches:  trunk
changeset: 583698:7e24c4c0ec53
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Aug 19 12:29:18 2005 +0000

description:
make ICMPPRINTFS work; from Liam Foy.

diffstat:

 sys/netinet/ip_icmp.c |  30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)

diffs (79 lines):

diff -r a8c5fabe9a4e -r 7e24c4c0ec53 sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c     Fri Aug 19 12:28:37 2005 +0000
+++ b/sys/netinet/ip_icmp.c     Fri Aug 19 12:29:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_icmp.c,v 1.94 2005/08/05 09:21:25 elad Exp $        */
+/*     $NetBSD: ip_icmp.c,v 1.95 2005/08/19 12:29:18 christos Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.94 2005/08/05 09:21:25 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.95 2005/08/19 12:29:18 christos Exp $");
 
 #include "opt_ipsec.h"
 
@@ -236,7 +236,8 @@
 
 #ifdef ICMPPRINTFS
        if (icmpprintfs)
-               printf("icmp_error(%x, %d, %d)\n", oip, type, code);
+               printf("icmp_error(%p, type:%d, code:%d)\n", oip, type,
+                       code);
 #endif
        if (type != ICMP_REDIRECT)
                icmpstat.icps_error++;
@@ -395,10 +396,10 @@
         */
        icmplen = ntohs(ip->ip_len) - hlen;
 #ifdef ICMPPRINTFS
-       if (icmpprintfs)
-               printf("icmp_input from %x to %x, len %d\n",
-                   ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr),
-                   icmplen);
+       if (icmpprintfs) {
+               printf("icmp_input from `%s' to ", inet_ntoa(ip->ip_src));
+               printf("`%s', len %d\n", inet_ntoa(ip->ip_dst), icmplen);
+       }
 #endif
        if (icmplen < ICMP_MINLEN) {
                icmpstat.icps_tooshort++;
@@ -426,7 +427,7 @@
         * Message type specific processing.
         */
        if (icmpprintfs)
-               printf("icmp_input, type %d code %d\n", icp->icmp_type,
+               printf("icmp_input(type:%d, code:%d)\n", icp->icmp_type,
                    icp->icmp_code);
 #endif
        if (icp->icmp_type > ICMP_MAXTYPE)
@@ -579,9 +580,10 @@
                icmpgw.sin_addr = ip->ip_src;
                icmpdst.sin_addr = icp->icmp_gwaddr;
 #ifdef ICMPPRINTFS
-               if (icmpprintfs)
-                       printf("redirect dst %x to %x\n", icp->icmp_ip.ip_dst,
-                           icp->icmp_gwaddr);
+               if (icmpprintfs) {
+                       printf("redirect dst `%s' to ", inet_ntoa(icp->icmp_ip.ip_dst));
+                       printf("`%s'\n", inet_ntoa(icp->icmp_gwaddr));
+               }
 #endif
                icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
                rt = NULL;
@@ -863,8 +865,10 @@
        m->m_data -= hlen;
        m->m_len += hlen;
 #ifdef ICMPPRINTFS
-       if (icmpprintfs)
-               printf("icmp_send dst %x src %x\n", ip->ip_dst, ip->ip_src);
+       if (icmpprintfs) {
+               printf("icmp_send to destination `%s' from ", inet_ntoa(ip->ip_dst));
+               printf("`%s'\n", inet_ntoa(ip->ip_src));
+       }
 #endif
        (void) ip_output(m, opts, NULL, 0,
            (struct ip_moptions *)NULL, (struct socket *)NULL);



Home | Main Index | Thread Index | Old Index