From baa818ae0a7967c63a77b2deeec7e497aa5408dc Mon Sep 17 00:00:00 2001 From: mickey Date: Tue, 7 May 1996 15:20:23 +0000 Subject: [PATCH] from NetBSD PR#2296: Laine Stump: some icmp destination unreachable packets contain garbage. --- sys/netinet/ip_icmp.c | 4 ++-- sys/netinet/ip_input.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index f4a8c0d6e16..acbe07ca094 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.3 1996/03/03 22:30:35 niklas Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.4 1996/05/07 15:20:23 mickey Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -120,7 +120,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 = oiplen + oip->ip_len; m->m_len = icmplen + ICMP_MINLEN; MH_ALIGN(m, m->m_len); icp = mtod(m, struct icmp *); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index aaf165f6916..94e0050aa85 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.11 1996/04/21 22:29:00 deraadt Exp $ */ +/* $OpenBSD: ip_input.c,v 1.12 1996/05/07 15:20:25 mickey Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -1102,10 +1102,10 @@ ip_forward(m, srcrt) } /* - * Save at most 64 bytes of the packet in case + * Save at most 68 bytes of the packet in case * we need to generate an ICMP message to the src. */ - mcopy = m_copy(m, 0, imin((int)ip->ip_len, 64)); + mcopy = m_copy(m, 0, imin((int)ip->ip_len, 68)); /* * If forwarding packet using same interface that it came in on, -- 2.20.1