Fixed the bug I have introduced in icmp_error() in revision 1.44.

The amount of data we copy from the original IP datagram into the
ICMP message was computed incorrectly for IP packets with payload
less than 8 bytes.
This commit is contained in:
Ruslan Ermilov 2000-11-02 09:46:23 +00:00
parent 0625bcba04
commit 1d02752206

View File

@ -163,7 +163,7 @@ icmp_error(n, type, code, dest, destifp)
m = m_gethdr(M_DONTWAIT, MT_HEADER);
if (m == NULL)
goto freeit;
icmplen = oiplen + min(8, oip->ip_len);
icmplen = min(oiplen + 8, oip->ip_len);
m->m_len = icmplen + ICMP_MINLEN;
MH_ALIGN(m, m->m_len);
icp = mtod(m, struct icmp *);