From owner-freebsd-net@FreeBSD.ORG Sun Sep 5 20:52:52 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC15A16A4CE; Sun, 5 Sep 2004 20:52:52 +0000 (GMT) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id E793943D39; Sun, 5 Sep 2004 20:52:51 +0000 (GMT) (envelope-from glebius@freebsd.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.11/8.12.8) with ESMTP id i85Kqne6081379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Sep 2004 00:52:50 +0400 (MSD) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.sick.ru (8.12.11/8.12.11/Submit) id i85KqnMw081378; Mon, 6 Sep 2004 00:52:49 +0400 (MSD) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@freebsd.org using -f Date: Mon, 6 Sep 2004 00:52:49 +0400 From: Gleb Smirnoff To: luigi@freebsd.org Message-ID: <20040905205249.GA81337@cell.sick.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline User-Agent: Mutt/1.5.6i cc: hackers@freebsd.org cc: net@freebsd.org Subject: bridge callbacks in if_ed.c? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2004 20:52:53 -0000 --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Luigi, I see that bridge callbacks are still living in if_ed.c from FreeBSD 2.x times. See if_ed.c:2816. I think this is not correct. Bridge code is called from ether_input(), which is indirectly called from if_ed.c:2836. Any objections about attached patch? [ccing hackers@ and net@ to get more eyes reviewing] -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename="if_ed.c.diff" Index: if_ed.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ed/if_ed.c,v retrieving revision 1.233 diff -u -r1.233 if_ed.c --- if_ed.c 13 Aug 2004 23:04:23 -0000 1.233 +++ if_ed.c 5 Sep 2004 20:48:19 -0000 @@ -2810,26 +2810,9 @@ eh = mtod(m, struct ether_header *); /* - * Don't read in the entire packet if we know we're going to drop it - * and no bpf is active. + * Get packet, including link layer address, from interface. */ - if (!ifp->if_bpf && BDG_ACTIVE( (ifp) ) ) { - struct ifnet *bif; - - ed_ring_copy(sc, buf, (char *)eh, ETHER_HDR_LEN); - bif = bridge_in_ptr(ifp, eh) ; - if (bif == BDG_DROP) { - m_freem(m); - return; - } - if (len > ETHER_HDR_LEN) - ed_ring_copy(sc, buf + ETHER_HDR_LEN, - (char *)(eh + 1), len - ETHER_HDR_LEN); - } else - /* - * Get packet, including link layer address, from interface. - */ - ed_ring_copy(sc, buf, (char *)eh, len); + ed_ring_copy(sc, buf, (char *)eh, len); m->m_pkthdr.len = m->m_len = len; --sdtB3X0nJg68CQEu--