From owner-freebsd-current@FreeBSD.ORG Fri Oct 8 11:34:14 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A448516A4CE; Fri, 8 Oct 2004 11:34:14 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA02C43D49; Fri, 8 Oct 2004 11:34:13 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])i98BXcDW008558; Fri, 8 Oct 2004 14:33:56 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i98BXS7G000646; Fri, 8 Oct 2004 14:33:28 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)i98BXSvx000645; Fri, 8 Oct 2004 14:33:28 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Fri, 8 Oct 2004 14:33:28 +0300 From: Giorgos Keramidas To: re@freebsd.org Message-ID: <20041008113328.GA593@orion.daedalusnetworks.priv> References: <200410080741.i987f4aq028615@pooker.samsco.org> <20041008092354.GB41183@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041008092354.GB41183@orion.daedalusnetworks.priv> cc: current@freebsd.org Subject: Re: 5.3-RELEASE TODO X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 11:34:14 -0000 On 2004-10-08 12:23, Giorgos Keramidas wrote: > --- patch begins here --- Ignore that previous patch. It doesn't build. Here's a version that builds fine, which I'm testing now: %%% Index: ethernet.h =================================================================== RCS file: /home/ncvs/src/sys/net/ethernet.h,v retrieving revision 1.24 diff -u -r1.24 ethernet.h --- ethernet.h 5 Oct 2004 19:28:52 -0000 1.24 +++ ethernet.h 8 Oct 2004 11:18:30 -0000 @@ -353,7 +353,7 @@ extern uint32_t ether_crc32_le(const uint8_t *, size_t); extern uint32_t ether_crc32_be(const uint8_t *, size_t); -extern void ether_demux(struct ifnet *, struct mbuf *); +extern int ether_demux(struct ifnet *, struct mbuf *); extern void ether_ifattach(struct ifnet *, const u_int8_t *); extern void ether_ifdetach(struct ifnet *); extern int ether_ioctl(struct ifnet *, int, caddr_t); Index: if_ethersubr.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.177 diff -u -r1.177 if_ethersubr.c --- if_ethersubr.c 27 Jul 2004 23:20:45 -0000 1.177 +++ if_ethersubr.c 8 Oct 2004 11:22:09 -0000 @@ -614,16 +614,14 @@ } } - ether_demux(ifp, m); - /* First chunk of an mbuf contains good entropy */ - if (harvest.ethernet) - random_harvest(m, 16, 3, 0, RANDOM_NET); + if (ether_demux(ifp, m) == 0 && harvest.ethernet) + random_harvest(m->m_data, 16, 3, 0, RANDOM_NET); } /* * Upper layer processing for a received Ethernet packet. */ -void +int ether_demux(struct ifnet *ifp, struct mbuf *m) { struct ether_header *eh; @@ -666,14 +664,14 @@ IFP2AC(ifp)->ac_enaddr, ETHER_ADDR_LEN) != 0 && (ifp->if_flags & IFF_PPROMISC) == 0) { m_freem(m); - return; + return (-1); } } /* Discard packet if interface is not up */ if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); - return; + return (-1); } if (ETHER_IS_MULTICAST(eh->ether_dhost)) { if (bcmp(etherbroadcastaddr, eh->ether_dhost, @@ -691,7 +689,7 @@ if (ether_ipfw_chk(&m, NULL, &rule, 0) == 0) { if (m) m_freem(m); - return; + return (-1); } } #endif @@ -709,7 +707,7 @@ */ KASSERT(vlan_input_p != NULL,("ether_input: VLAN not loaded!")); (*vlan_input_p)(ifp, m); - return; + return (-1); } /* @@ -725,7 +723,7 @@ ifp->if_noproto++; m_freem(m); } - return; + return (-1); } /* Strip off Ethernet header. */ @@ -741,7 +739,7 @@ #ifdef INET case ETHERTYPE_IP: if (ip_fastforward(m)) - return; + return (0); isr = NETISR_IP; break; @@ -749,7 +747,7 @@ if (ifp->if_flags & IFF_NOARP) { /* Discard packet if ARP is disabled on interface */ m_freem(m); - return; + return (-1); } isr = NETISR_ARP; break; @@ -805,7 +803,7 @@ goto discard; } netisr_dispatch(isr, m); - return; + return 0; discard: /* @@ -820,9 +818,10 @@ */ M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); (*ng_ether_input_orphan_p)(ifp, m); - return; + return 0; } m_freem(m); + return (-1); } /* %%%