From owner-svn-src-head@FreeBSD.ORG Tue Jul 28 17:16:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFE21065673; Tue, 28 Jul 2009 17:16:55 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BC818FC08; Tue, 28 Jul 2009 17:16:55 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SHGt7g038666; Tue, 28 Jul 2009 17:16:55 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SHGtGC038664; Tue, 28 Jul 2009 17:16:55 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200907281716.n6SHGtGC038664@svn.freebsd.org> From: Qing Li Date: Tue, 28 Jul 2009 17:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195921 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 17:16:55 -0000 Author: qingli Date: Tue Jul 28 17:16:54 2009 New Revision: 195921 URL: http://svn.freebsd.org/changeset/base/195921 Log: The new flow table caches both the routing table entry as well as the L2 information. For an indirect route the cached L2 entry contains the MAC address of the gateway. Typically the default route is used to transmit multicast packets when explicit multicast routes are not available. The ether_output() function bypasses L2 resolution function if it verifies the L2 cache is valid, because the cached L2 address (a unicast MAC address) is copied into the packets as the destination MAC address. This validation, however, does not apply to broadcast and multicast packets because the destination MAC address is mapped according to a standard method instead. Submitted by: Xin Li Reviewed by: bz Approved by: re Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue Jul 28 15:57:53 2009 (r195920) +++ head/sys/net/if_ethersubr.c Tue Jul 28 17:16:54 2009 (r195921) @@ -174,7 +174,8 @@ ether_output(struct ifnet *ifp, struct m int hlen; /* link layer header length */ if (ro != NULL) { - lle = ro->ro_lle; + if (!(m->m_flags & (M_BCAST | M_MCAST))) + lle = ro->ro_lle; rt0 = ro->ro_rt; } #ifdef MAC