summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>2005-05-24 00:36:35 +0000
committerEric Norum <WENorum@lbl.gov>2005-05-24 00:36:35 +0000
commit2a94c854204833f8c3c3823091240cc4a60ce319 (patch)
treec9ab53e3c632b3a249908e4b6ae5a1fff54ac0eb
parent2005-05-23 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-2a94c854204833f8c3c3823091240cc4a60ce319.tar.bz2
Add "ICMP panic avoided" diagnostic counter.
-rw-r--r--cpukit/ChangeLog5
-rw-r--r--cpukit/libnetworking/netinet/ip_icmp.c6
-rw-r--r--cpukit/libnetworking/rtems/rtems_showicmpstat.c3
3 files changed, 12 insertions, 2 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index f6287721c1..a0e19d5a14 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -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.
diff --git a/cpukit/libnetworking/netinet/ip_icmp.c b/cpukit/libnetworking/netinet/ip_icmp.c
index 11e954dc9b..564a785b04 100644
--- a/cpukit/libnetworking/netinet/ip_icmp.c
+++ b/cpukit/libnetworking/netinet/ip_icmp.c
@@ -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
*/
diff --git a/cpukit/libnetworking/rtems/rtems_showicmpstat.c b/cpukit/libnetworking/rtems/rtems_showicmpstat.c
index dfe1bc45a4..13f378826a 100644
--- a/cpukit/libnetworking/rtems/rtems_showicmpstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showicmpstat.c
@@ -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");
}