Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet avoid shared cluster mbuf overwrite on multicast...



details:   https://anonhg.NetBSD.org/src/rev/7f65c98d09ad
branches:  trunk
changeset: 479721:7f65c98d09ad
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Dec 20 05:46:33 1999 +0000

description:
avoid shared cluster mbuf overwrite on multicast packet loopback.
(bsdi and freebsd fixed this a long time ago...)

PR: 9020
From: pavlin%catarina.usc.edu@localhost

diffstat:

 sys/netinet/ip_output.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 470acbb3ff45 -r 7f65c98d09ad sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c   Mon Dec 20 05:41:35 1999 +0000
+++ b/sys/netinet/ip_output.c   Mon Dec 20 05:46:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_output.c,v 1.64 1999/12/13 17:04:11 is Exp $        */
+/*     $NetBSD: ip_output.c,v 1.65 1999/12/20 05:46:33 itojun Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1486,6 +1486,9 @@
        struct mbuf *copym;
 
        copym = m_copy(m, 0, M_COPYALL);
+        if (copym != NULL
+        && (copym->m_flags & M_EXT || copym->m_len < sizeof(struct ip)))
+               copym = m_pullup(copym, sizeof(struct ip));
        if (copym != NULL) {
                /*
                 * We don't bother to fragment if the IP length is greater



Home | Main Index | Thread Index | Old Index