Add "ICMP panic avoided" diagnostic counter.

This commit is contained in:
Eric Norum
2005-05-24 00:36:35 +00:00
parent 290268f6b7
commit 2a94c85420
3 changed files with 12 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2005-05-23 Eric Norum <norume@aps.anl.gov>
* libnetworking/rtems/rtems_showicmpstat.c
* libnetworking/netinet/ip_icmp.c: note that a panic has been avoided
2005-05-23 Ralf Corsepius <ralf.corsepius@rtems.org>
* Makefile.am: Remove ada.

View File

@@ -97,6 +97,7 @@ static void icmp_reflect(struct mbuf *);
static void icmp_send(struct mbuf *, struct mbuf *);
extern struct protosw inetsw[];
unsigned int icmplenPanicAvoided;
/*
* Generate an error packet of type error
@@ -139,8 +140,11 @@ icmp_error(n, type, code, dest, destifp)
goto freeit;
/* Don't send error in response to malicious packet */
icmplen = min(oiplen + 8, oip->ip_len);
if (icmplen < sizeof(struct ip))
if (icmplen < sizeof(struct ip)) {
icmplenPanicAvoided++;
goto freeit;
}
/*
* First, formulate icmp message
*/

View File

@@ -36,6 +36,7 @@ rtems_bsdnet_show_icmp_stats (void)
{
int i;
char cbuf[20];
extern unsigned int icmplenPanicAvoided;
printf ("************ ICMP Statistics ************\n");
showicmpstat ("Calls to icmp_error()", icmpstat.icps_error);
@@ -59,6 +60,6 @@ rtems_bsdnet_show_icmp_stats (void)
showicmpstat (cbuf, icmpstat.icps_inhist[i]);
}
}
showicmpstat ("ICMP panic avoided", icmplenPanicAvoided);
printf ("\n");
}