mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 22:48:23 +00:00
Add "ICMP panic avoided" diagnostic counter.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user