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
This commit is contained in:
andre 2005-08-22 22:13:41 +00:00
parent c525799625
commit 9b00236fed

View File

@ -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 *);