From e238590f91c031ad2ab4dce1ed207067700fd66b Mon Sep 17 00:00:00 2001 From: ru Date: Thu, 2 Nov 2000 09:46:23 +0000 Subject: 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. --- sys/netinet/ip_icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/netinet/ip_icmp.c') diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index dc2040e..eb68d1d 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -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 *); -- cgit v1.1