From owner-p4-projects Tue Dec 10 8:41: 0 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BC6F937B404; Tue, 10 Dec 2002 08:40:58 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6403A37B401 for ; Tue, 10 Dec 2002 08:40:58 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 162E643EB2 for ; Tue, 10 Dec 2002 08:40:58 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBAGaBmV083286 for ; Tue, 10 Dec 2002 08:36:11 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBAGaB6Y083280 for perforce@freebsd.org; Tue, 10 Dec 2002 08:36:11 -0800 (PST) Date: Tue, 10 Dec 2002 08:36:11 -0800 (PST) Message-Id: <200212101636.gBAGaB6Y083280@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 22136 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=22136 Change 22136 by rwatson@rwatson_tislabs on 2002/12/10 08:35:53 Tweak the way we special case the evil in the loopback interface to deal with improper mbuf header copying. Affected files ... .. //depot/projects/trustedbsd/mac/sys/net/if_loop.c#13 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/net/if_loop.c#13 (text+ko) ==== @@ -205,10 +205,6 @@ return (rt->rt_flags & RTF_BLACKHOLE ? 0 : rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH); } -#if 0 - /* - * XXXMAC: this needs to use M_COPY_PKTHDR(), among other things. - */ /* * KAME requires that the packet to be contiguous on the @@ -228,13 +224,18 @@ goto contiguousfail; } -#ifdef MAC - mac_create_mbuf_from_mbuf(m, n); -#endif m_copydata(m, 0, m->m_pkthdr.len, mtod(n, caddr_t)); n->m_pkthdr = m->m_pkthdr; n->m_len = m->m_pkthdr.len; SLIST_INIT(&m->m_pkthdr.tags); +#ifdef MAC + /* + * XXXMAC: Once we put labels in tags and proper + * primitives are used for relocating mbuf header + * data, this will no longer be required. + */ + mac_init_mbuf(m, M_WAITOK); +#endif m_freem(m); m = n; } @@ -242,7 +243,6 @@ contiguousfail: printf("looutput: mbuf allocation failed\n"); } -#endif ifp->if_opackets++; ifp->if_obytes += m->m_pkthdr.len; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message