summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_icmp.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2000-11-02 09:46:23 +0000
committerru <ru@FreeBSD.org>2000-11-02 09:46:23 +0000
commite238590f91c031ad2ab4dce1ed207067700fd66b (patch)
treed257652dc3e0b4beec503b8baf31af145c0f9ecf /sys/netinet/ip_icmp.c
parent3ee0d9abbd9fba92693ae98f15d15aa0c37d21f1 (diff)
downloadFreeBSD-src-e238590f91c031ad2ab4dce1ed207067700fd66b.zip
FreeBSD-src-e238590f91c031ad2ab4dce1ed207067700fd66b.tar.gz
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.
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r--sys/netinet/ip_icmp.c2
1 files changed, 1 insertions, 1 deletions
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 *);
OpenPOWER on IntegriCloud