summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libnetworking/netinet')
-rw-r--r--cpukit/libnetworking/netinet/ip_icmp.c6
1 files changed, 5 insertions, 1 deletions
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
*/