Source-Changes-HG archive

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

[src/trunk]: src Retire ICMPPRINTFS, it's annoying and it doesn'...



details:   https://anonhg.NetBSD.org/src/rev/574c5c267472
branches:  trunk
changeset: 318981:574c5c267472
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri May 11 14:38:28 2018 +0000
description:
Retire ICMPPRINTFS, it's annoying and it doesn't build.

diffstat:

 share/man/man4/options.4 |  11 +-------
 sys/netinet/ip_icmp.c    |  58 +++--------------------------------------------
 sys/netmpls/mpls_ttl.c   |   9 +-----
 3 files changed, 8 insertions(+), 70 deletions(-)

diffs (197 lines):

diff -r deef78897f41 -r 574c5c267472 share/man/man4/options.4
--- a/share/man/man4/options.4  Fri May 11 14:25:50 2018 +0000
+++ b/share/man/man4/options.4  Fri May 11 14:38:28 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: options.4,v 1.486 2018/04/09 07:08:43 wiz Exp $
+.\"    $NetBSD: options.4,v 1.487 2018/05/11 14:38:28 maxv Exp $
 .\"
 .\" Copyright (c) 1996
 .\"    Perry E. Metzger.  All rights reserved.
@@ -30,7 +30,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd April 5, 2018
+.Dd May 11, 2018
 .Dt OPTIONS 4
 .Os
 .Sh NAME
@@ -1681,13 +1681,6 @@
 has no impact on protocols other than IP, such as CLNP).
 .Em GATEWAY
 option also compiles IPv4 and IPv6 fast forwarding code into the kernel.
-.It Cd options ICMPPRINTFS
-The
-.Em ICMPPRINTFS
-option will enable debugging information to be printed about
-the
-.Xr icmp 4
-protocol.
 .It Cd options IPFORWARDING=value
 If
 .Em value
diff -r deef78897f41 -r 574c5c267472 sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c     Fri May 11 14:25:50 2018 +0000
+++ b/sys/netinet/ip_icmp.c     Fri May 11 14:38:28 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_icmp.c,v 1.169 2018/04/26 07:28:21 maxv Exp $       */
+/*     $NetBSD: ip_icmp.c,v 1.170 2018/05/11 14:38:28 maxv Exp $       */
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -94,7 +94,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.169 2018/04/26 07:28:21 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.170 2018/05/11 14:38:28 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -140,9 +140,6 @@
 
 int icmpmaskrepl = 0;
 int icmpbmcastecho = 0;
-#ifdef ICMPPRINTFS
-int icmpprintfs = 0;
-#endif
 int icmpreturndatabytes = 8;
 
 percpu_t *icmpstat_percpu;
@@ -261,11 +258,6 @@
        unsigned datalen, mblen;
        int totlen;
 
-#ifdef ICMPPRINTFS
-       if (icmpprintfs)
-               printf("icmp_error(%p, type:%d, code:%d)\n", oip, type, code);
-#endif
-
        if (type != ICMP_REDIRECT)
                ICMP_STATINC(ICMP_STAT_ERROR);
 
@@ -435,14 +427,6 @@
         * that not corrupted and of at least minimum length.
         */
        icmplen = ntohs(ip->ip_len) - hlen;
-#ifdef ICMPPRINTFS
-       if (icmpprintfs) {
-               char sbuf[INET_ADDRSTRLEN], dbuf[INET_ADDRSTRLEN];
-               printf("icmp_input from `%s' to `%s', len %d\n",
-                   IN_PRINT(sbuf, &ip->ip_src), IN_PRINT(dbuf, &ip->ip_dst),
-                   icmplen);
-       }
-#endif
        if (icmplen < ICMP_MINLEN) {
                ICMP_STATINC(ICMP_STAT_TOOSHORT);
                goto freeit;
@@ -464,14 +448,6 @@
        m->m_len += hlen;
        m->m_data -= hlen;
 
-#ifdef ICMPPRINTFS
-       /*
-        * Message type specific processing.
-        */
-       if (icmpprintfs)
-               printf("icmp_input(type:%d, code:%d)\n", icp->icmp_type,
-                   icp->icmp_code);
-#endif
        if (icp->icmp_type > ICMP_MAXTYPE)
                goto raw;
        ICMP_STATINC(ICMP_STAT_INHIST + icp->icmp_type);
@@ -556,10 +532,7 @@
 
                if (IN_MULTICAST(icp->icmp_ip.ip_dst.s_addr))
                        goto badcode;
-#ifdef ICMPPRINTFS
-               if (icmpprintfs)
-                       printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
-#endif
+
                icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
                ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
                if (ctlfunc)
@@ -664,14 +637,6 @@
                 */
                icmpgw.sin_addr = ip->ip_src;
                icmpdst.sin_addr = icp->icmp_gwaddr;
-#ifdef ICMPPRINTFS
-               if (icmpprintfs) {
-                       char gbuf[INET_ADDRSTRLEN], dbuf[INET_ADDRSTRLEN];
-                       printf("redirect dst `%s' to `%s'\n",
-                           IN_PRINT(dbuf, &icp->icmp_ip.ip_dst),
-                           IN_PRINT(gbuf, &icp->icmp_gwaddr));
-               }
-#endif
                icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
                rt = NULL;
                rtredirect(sintosa(&icmpsrc), sintosa(&icmpdst),
@@ -908,11 +873,6 @@
                }
 
                if (opts) {
-#ifdef ICMPPRINTFS
-                       if (icmpprintfs)
-                               printf("icmp_reflect optlen %d rt %d => ",
-                                   optlen, opts->m_len);
-#endif
                        for (cnt = optlen; cnt > 0; cnt -= len, cp += len) {
                                opt = cp[IPOPT_OPTVAL];
                                if (opt == IPOPT_EOL)
@@ -947,10 +907,6 @@
                                        opts->m_len++;
                                }
                        }
-#ifdef ICMPPRINTFS
-                       if (icmpprintfs)
-                               printf("%d\n", opts->m_len);
-#endif
                }
 
                /*
@@ -1001,13 +957,7 @@
        icp->icmp_cksum = in_cksum(m, ntohs(ip->ip_len) - hlen);
        m->m_data -= hlen;
        m->m_len += hlen;
-#ifdef ICMPPRINTFS
-       if (icmpprintfs) {
-               char sbuf[INET_ADDRSTRLEN], dbuf[INET_ADDRSTRLEN];
-               printf("icmp_send to destination `%s' from `%s'\n",
-                   IN_PRINT(dbuf, &ip->ip_dst), IN_PRINT(sbuf, &ip->ip_src));
-       }
-#endif
+
        (void)ip_output(m, opts, NULL, 0, NULL, NULL);
 }
 
diff -r deef78897f41 -r 574c5c267472 sys/netmpls/mpls_ttl.c
--- a/sys/netmpls/mpls_ttl.c    Fri May 11 14:25:50 2018 +0000
+++ b/sys/netmpls/mpls_ttl.c    Fri May 11 14:38:28 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpls_ttl.c,v 1.12 2018/04/11 06:37:32 maxv Exp $ */
+/*     $NetBSD: mpls_ttl.c,v 1.13 2018/05/11 14:38:28 maxv Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpls_ttl.c,v 1.12 2018/04/11 06:37:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpls_ttl.c,v 1.13 2018/05/11 14:38:28 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -177,11 +177,6 @@
 
        mpls_icmp_ext.ms.s_addr = shim->s_addr;
 
-#ifdef ICMPPRINTFS
-       if (icmpprintfs)
-               printf("mpls_icmp_error(%p, type:%d, code:%d)\n", oip, type,
-                       code);
-#endif
        if (type != ICMP_REDIRECT)
                ICMP_STATINC(ICMP_STAT_ERROR);
 



Home | Main Index | Thread Index | Old Index