From 2a94c854204833f8c3c3823091240cc4a60ce319 Mon Sep 17 00:00:00 2001 From: Eric Norum Date: Tue, 24 May 2005 00:36:35 +0000 Subject: Add "ICMP panic avoided" diagnostic counter. --- cpukit/libnetworking/netinet/ip_icmp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cpukit/libnetworking/netinet') 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 */ -- cgit v1.2.3