From 4db39a7dbf7d2650eade446ee58ac5d16a22170b Mon Sep 17 00:00:00 2001 From: dyoung Date: Wed, 29 Mar 2006 21:13:55 +0000 Subject: [PATCH] When reflecting an ICMP Echo, do not scribble over read-only/shared mbuf storage. --- sys/netinet/ip_icmp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 7c2ababcd8e0..cebe25b79a76 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.c,v 1.98 2006/03/22 01:07:24 matt Exp $ */ +/* $NetBSD: ip_icmp.c,v 1.99 2006/03/29 21:13:55 dyoung Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -101,7 +101,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.98 2006/03/22 01:07:24 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.99 2006/03/29 21:13:55 dyoung Exp $"); #include "opt_ipsec.h" @@ -405,7 +405,7 @@ icmp_input(struct mbuf *m, ...) goto freeit; } i = hlen + min(icmplen, ICMP_ADVLENMIN); - if (m->m_len < i && (m = m_pullup(m, i)) == 0) { + if ((m->m_len < i || M_READONLY(m)) && (m = m_pullup(m, i)) == 0) { icmpstat.icps_tooshort++; return; }