summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/netinet
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>2006-05-30 15:12:54 +0000
committerEric Norum <WENorum@lbl.gov>2006-05-30 15:12:54 +0000
commit261e743d66d3f666cd3a683a044c428c241ca457 (patch)
tree0ba6b2186a6318fb21ad2949a57b8598fc114809 /cpukit/libnetworking/netinet
parentThis commit was generated by cvs2svn to compensate for changes in r13434, (diff)
downloadrtems-261e743d66d3f666cd3a683a044c428c241ca457.tar.bz2
Add flag to inhibit ICMP replies.
Diffstat (limited to 'cpukit/libnetworking/netinet')
-rw-r--r--cpukit/libnetworking/netinet/icmp_var.h1
-rw-r--r--cpukit/libnetworking/netinet/ip_icmp.c11
2 files changed, 9 insertions, 3 deletions
diff --git a/cpukit/libnetworking/netinet/icmp_var.h b/cpukit/libnetworking/netinet/icmp_var.h
index 8e005822ba..da74e58f98 100644
--- a/cpukit/libnetworking/netinet/icmp_var.h
+++ b/cpukit/libnetworking/netinet/icmp_var.h
@@ -54,6 +54,7 @@ struct icmpstat {
u_long icps_badlen; /* calculated bound mismatch */
u_long icps_reflect; /* number of responses */
u_long icps_inhist[ICMP_MAXTYPE + 1];
+ u_long icps_allecho; /* all echo requests dropped */
u_long icps_bmcastecho; /* b/mcast echo requests dropped */
u_long icps_bmcasttstamp; /* b/mcast tstamp requests dropped */
};
diff --git a/cpukit/libnetworking/netinet/ip_icmp.c b/cpukit/libnetworking/netinet/ip_icmp.c
index 564a785b04..7cd2668aa9 100644
--- a/cpukit/libnetworking/netinet/ip_icmp.c
+++ b/cpukit/libnetworking/netinet/ip_icmp.c
@@ -88,6 +88,10 @@ static int icmpbmcastecho = 1;
SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho,
0, "");
+static int icmpallecho = 1;
+SYSCTL_INT(_net_inet_icmp, OID_AUTO, allecho, CTLFLAG_RW, &icmpallecho,
+ 0, "");
+
/* #define ICMPPRINTFS 1 */
#ifdef ICMPPRINTFS
int icmpprintfs = 0;
@@ -399,9 +403,10 @@ icmp_input(m, off)
break;
case ICMP_ECHO:
- if (!icmpbmcastecho
- && (m->m_flags & (M_MCAST | M_BCAST)) != 0
- && IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
+ if (!icmpallecho
+ || (!icmpbmcastecho
+ && (m->m_flags & (M_MCAST | M_BCAST)) != 0
+ && IN_MULTICAST(ntohl(ip->ip_dst.s_addr)))) {
icmpstat.icps_bmcastecho++;
break;
}