Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/netinet Pullup 1.119 [itojun]:



details:   https://anonhg.NetBSD.org/src/rev/94a8d22f8088
branches:  netbsd-1-5
changeset: 489760:94a8d22f8088
user:      tv <tv%NetBSD.org@localhost>
date:      Tue Oct 17 00:59:49 2000 +0000

description:
Pullup 1.119 [itojun]:
make sure we don't share external mbuf between m and mcopy, in ip_forward().
should solve PR 11201.

diffstat:

 sys/netinet/ip_input.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 99fa8157e64a -r 94a8d22f8088 sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c    Tue Oct 17 00:56:32 2000 +0000
+++ b/sys/netinet/ip_input.c    Tue Oct 17 00:59:49 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_input.c,v 1.114.4.2 2000/08/27 01:11:04 itojun Exp $        */
+/*     $NetBSD: ip_input.c,v 1.114.4.3 2000/10/17 00:59:49 tv Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1398,8 +1398,11 @@
        /*
         * Save at most 68 bytes of the packet in case
         * we need to generate an ICMP message to the src.
+        * Pullup to avoid sharing mbuf cluster between m and mcopy.
         */
-       mcopy = m_copy(m, 0, imin((int)ip->ip_len, 68));
+       mcopy = m_copym(m, 0, imin((int)ip->ip_len, 68), M_DONTWAIT);
+       if (mcopy)
+               mcopy = m_pullup(mcopy, ip->ip_hl << 2);
 
        /*
         * If forwarding packet using same interface that it came in on,



Home | Main Index | Thread Index | Old Index