diff options
| author | Andre Oppermann <andre@FreeBSD.org> | 2005-08-22 22:13:41 +0000 |
|---|---|---|
| committer | Andre Oppermann <andre@FreeBSD.org> | 2005-08-22 22:13:41 +0000 |
| commit | 23655387e99db32f3b446b55a0e76720ecbe39ea (patch) | |
| tree | 04157ed526c2defe230c8b77c157cc4efbd142ad /sys/netinet | |
| parent | 7380c1acb54b9e42c984b5f90413742ac78af177 (diff) | |
Notes
Diffstat (limited to 'sys/netinet')
| -rw-r--r-- | sys/netinet/ip_icmp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 12ff81472893..00b2341f7efd 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 *); |
