summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_icmp.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2005-08-22 22:13:41 +0000
committerandre <andre@FreeBSD.org>2005-08-22 22:13:41 +0000
commit9b00236fed95ecaefebce94aa850d4a5343eb83d (patch)
tree04157ed526c2defe230c8b77c157cc4efbd142ad /sys/netinet/ip_icmp.c
parentc52579962562714b24587fe3760fa37244996096 (diff)
downloadFreeBSD-src-9b00236fed95ecaefebce94aa850d4a5343eb83d.zip
FreeBSD-src-9b00236fed95ecaefebce94aa850d4a5343eb83d.tar.gz
o Fix a logic error when not doing mbuf cluster allocation.
o Change an old panic() to a clean function exit. MFC after: 2 weeks Sponsored by: TCP/IP Optimization Fundraise 2005
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r--sys/netinet/ip_icmp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 12ff814..00b2341 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -213,11 +213,12 @@ icmp_error(n, type, code, dest, mtu)
} else
icmplen = min(oiplen + max(8, icmp_quotelen), oip->ip_len);
if (icmplen < sizeof(struct ip))
- panic("icmp_error: bad length");
- if (icmplen + ICMP_MINLEN + sizeof(struct ip) > MHLEN)
- MCLGET(m, M_DONTWAIT);
- if (!(m->m_flags & M_EXT))
goto freeit;
+ if (icmplen + ICMP_MINLEN + sizeof(struct ip) > MHLEN) {
+ MCLGET(m, M_DONTWAIT);
+ if (!(m->m_flags & M_EXT))
+ goto freeit;
+ }
m->m_len = icmplen + ICMP_MINLEN;
MH_ALIGN(m, m->m_len);
icp = mtod(m, struct icmp *);
OpenPOWER on IntegriCloud