Retire ICMPPRINTFS, it's annoying and it doesn't build.

This commit is contained in:
maxv 2018-05-11 14:38:28 +00:00
parent 7e3f605c35
commit 65f0aceba1
3 changed files with 8 additions and 70 deletions

View File

@ -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 @@ is not invoked directly.
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

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.169 2018/04/26 07:28:21 maxv Exp $");
int icmpmaskrepl = 0;
int icmpbmcastecho = 0;
#ifdef ICMPPRINTFS
int icmpprintfs = 0;
#endif
int icmpreturndatabytes = 8;
percpu_t *icmpstat_percpu;
@ -261,11 +258,6 @@ icmp_error(struct mbuf *n, int type, int code, n_long dest, int destmtu)
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 @@ _icmp_input(struct mbuf *m, int hlen, int proto)
* 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 @@ _icmp_input(struct mbuf *m, int hlen, int proto)
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 @@ _icmp_input(struct mbuf *m, int hlen, int proto)
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 @@ reflect:
*/
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 @@ icmp_reflect(struct mbuf *m)
}
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 @@ icmp_reflect(struct mbuf *m)
opts->m_len++;
}
}
#ifdef ICMPPRINTFS
if (icmpprintfs)
printf("%d\n", opts->m_len);
#endif
}
/*
@ -1001,13 +957,7 @@ icmp_send(struct mbuf *m, struct mbuf *opts)
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);
}

View File

@ -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_error(struct mbuf *n, int type, int code, n_long dest,
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);