From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 23 22:00:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6787CA4 for ; Mon, 23 Dec 2013 22:00:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 81A6312E3 for ; Mon, 23 Dec 2013 22:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNM00M6074596 for ; Mon, 23 Dec 2013 22:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rBNM00NW074595; Mon, 23 Dec 2013 22:00:00 GMT (envelope-from gnats) Resent-Date: Mon, 23 Dec 2013 22:00:00 GMT Resent-Message-Id: <201312232200.rBNM00NW074595@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sven-Thorsten Dietrich Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9A32A18 for ; Mon, 23 Dec 2013 21:52:59 +0000 (UTC) Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C4F0E12AB for ; Mon, 23 Dec 2013 21:52:59 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBNLqxpV046262 for ; Mon, 23 Dec 2013 21:52:59 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBNLqxvU046255; Mon, 23 Dec 2013 21:52:59 GMT (envelope-from nobody) Message-Id: <201312232152.rBNLqxvU046255@oldred.freebsd.org> Date: Mon, 23 Dec 2013 21:52:59 GMT From: Sven-Thorsten Dietrich To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/185148: Cleanup ip6_mroute.c X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 22:00:00 -0000 >Number: 185148 >Category: kern >Synopsis: Cleanup ip6_mroute.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Mon Dec 23 22:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Sven-Thorsten Dietrich >Release: HEAD >Organization: Vyatta >Environment: N/A >Description: The ip6_mforward function has unnecessary nesting. The first few lines check if a route exists, and if so, forward and return. The remaining 200 lines of the function are devoted to handling up calls to the route daemon. There is no need for the indentation. Rework the code from: if (rt) { MFC6_UNLOCK(); return (ip6_mdq(m, ifp, rt)); } else { /* 200 lines of necessary indentation */ } TO: if (rt) { MFC6_UNLOCK(); return (ip6_mdq(m, ifp, rt)); } /* same 200 lines without the extra tab */ There is no change in functionality and this patch doesn't attempt to join line-breaks. (to retain clarity -- do that later) >How-To-Repeat: >Fix: apply patch Patch attached with submission follows: Subject: Don't count table lookups from add_mfc. Signed-off-by: Sven-Thorsten Dietrich Index: sys/netinet6/ip6_mroute.c =================================================================== --- sys/netinet6/ip6_mroute.c (revision 256126) +++ sys/netinet6/ip6_mroute.c (working copy) @@ -275,7 +275,6 @@ #define MF6CFIND(o, g, rt) do { \ struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \ rt = NULL; \ - MRT6STAT_INC(mrt6s_mfc_lookups); \ while (_rt) { \ if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \ IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \ @@ -1124,6 +1123,7 @@ /* * Determine forwarding mifs from the forwarding cache table */ + MRT6STAT_INC(mrt6s_mfc_lookups); MF6CFIND(ip6->ip6_src, ip6->ip6_dst, rt); /* Entry exists, so forward if necessary */ >Release-Note: >Audit-Trail: >Unformatted: