forked from Imagelibrary/rtems
Add flag to inhibit ICMP replies.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2006-05-30 Eric Norum <norume@aps.anl.gov>
|
||||
|
||||
* libnetworking/netinet/icmp_var.h,
|
||||
libnetworking/netinet/ip_icmp.c,
|
||||
libnetworking/rtems/rtems_showicmpstat.c: Add flag to inhibit ICMP replies.
|
||||
|
||||
2006-05-25 Eric Norum <norume@aps.anl.gov>
|
||||
|
||||
* libnetworking/Makefile.am,
|
||||
|
||||
@@ -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 */
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ rtems_bsdnet_show_icmp_stats (void)
|
||||
showicmpstat ("bad checksum", icmpstat.icps_checksum);
|
||||
showicmpstat ("calculated bound mismatch", icmpstat.icps_badlen);
|
||||
showicmpstat ("number of responses", icmpstat.icps_reflect);
|
||||
showicmpstat ("all echo requests dropped", icmpstat.icps_allecho);
|
||||
showicmpstat ("b/mcast echo requests dropped", icmpstat.icps_bmcastecho);
|
||||
showicmpstat ("b/mcast tstamp requests dropped", icmpstat.icps_bmcasttstamp);
|
||||
for (i = 0 ; i <= ICMP_MAXTYPE ; i++) {
|
||||
|
||||
Reference in New Issue
Block a user