From owner-svn-src-all@freebsd.org Mon May 4 15:07:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF9F22D24AB; Mon, 4 May 2020 15:07:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49G5nn648hz4K36; Mon, 4 May 2020 15:07:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB974260BC; Mon, 4 May 2020 15:07:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 044F7vpq050633; Mon, 4 May 2020 15:07:57 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044F7vwD050632; Mon, 4 May 2020 15:07:57 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005041507.044F7vwD050632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 May 2020 15:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360631 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 360631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2020 15:07:58 -0000 Author: melifaro Date: Mon May 4 15:07:57 2020 New Revision: 360631 URL: https://svnweb.freebsd.org/changeset/base/360631 Log: Switch DDB show route to direct rnh_matchaddr() call instead of rtalloc1(). Eliminate the last rtalloc1() call to finish transition to the new routing KPI defined in r359823. Differential Revision: https://reviews.freebsd.org/D24663 Modified: head/sys/net/route/route_ddb.c Modified: head/sys/net/route/route_ddb.c ============================================================================== --- head/sys/net/route/route_ddb.c Mon May 4 15:00:19 2020 (r360630) +++ head/sys/net/route/route_ddb.c Mon May 4 15:07:57 2020 (r360631) @@ -208,6 +208,8 @@ DB_SHOW_COMMAND(routetable, db_show_routetable_cmd) _DB_FUNC(_show, route, db_show_route_cmd, db_show_table, CS_OWN, NULL) { char abuf[INET6_ADDRSTRLEN], *buf, *end; + struct rib_head *rh; + struct radix_node *rn; void *dst_addrp; struct rtentry *rt; union { @@ -244,8 +246,15 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl if (inet_ntop(af, dst_addrp, abuf, sizeof(abuf)) != NULL) db_printf("Looking up route to destination '%s'\n", abuf); + rt = NULL; CURVNET_SET(vnet0); - rt = rtalloc1((struct sockaddr *)&u, 0, RTF_RNH_LOCKED); + + rh = rt_tables_get_rnh(RT_DEFAULT_FIB, af); + + rn = rh->rnh_matchaddr(&u, &rh->head); + if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) + rt = (struct rtentry *)rn; + CURVNET_RESTORE(); if (rt == NULL) { @@ -254,7 +263,6 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl } rt_dumpentry_ddb((void *)rt, NULL); - RTFREE_LOCKED(rt); return; usage: