From owner-svn-src-head@freebsd.org Sun May 10 09:34:49 2020 Return-Path: Delivered-To: svn-src-head@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 A0E442DFAB7; Sun, 10 May 2020 09:34:49 +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 49Kf6d3l7Sz3ySH; Sun, 10 May 2020 09:34:49 +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 7BA122EFA; Sun, 10 May 2020 09:34:49 +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 04A9YnRc006388; Sun, 10 May 2020 09:34:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A9YnB5006386; Sun, 10 May 2020 09:34:49 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005100934.04A9YnB5006386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 May 2020 09:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360866 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 360866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 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: Sun, 10 May 2020 09:34:49 -0000 Author: melifaro Date: Sun May 10 09:34:48 2020 New Revision: 360866 URL: https://svnweb.freebsd.org/changeset/base/360866 Log: Remove rtalloc1(_fib) KPI. Last user of rtalloc1() KPI has been eliminated in rS360631. As kernel is now fully switched to use new routing KPI defined in rS359823, remove old lookup functions. Differential Revision: https://reviews.freebsd.org/D24776 Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun May 10 03:36:11 2020 (r360865) +++ head/sys/net/route.c Sun May 10 09:34:48 2020 (r360866) @@ -420,76 +420,6 @@ sys_setfib(struct thread *td, struct setfib_args *uap) } /* - * Look up the route that matches the address given - * Or, at least try.. Create a cloned route if needed. - * - * The returned route, if any, is locked. - */ -struct rtentry * -rtalloc1(struct sockaddr *dst, int report, u_long ignflags) -{ - - return (rtalloc1_fib(dst, report, ignflags, RT_DEFAULT_FIB)); -} - -struct rtentry * -rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags, - u_int fibnum) -{ - RIB_RLOCK_TRACKER; - struct rib_head *rh; - struct radix_node *rn; - struct rtentry *newrt; - struct rt_addrinfo info; - int err = 0, msgtype = RTM_MISS; - - KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); - rh = rt_tables_get_rnh(fibnum, dst->sa_family); - newrt = NULL; - if (rh == NULL) - goto miss; - - /* - * Look up the address in the table for that Address Family - */ - if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RLOCK(rh); -#ifdef INVARIANTS - else - RIB_LOCK_ASSERT(rh); -#endif - rn = rh->rnh_matchaddr(dst, &rh->head); - if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { - newrt = RNTORT(rn); - RT_LOCK(newrt); - RT_ADDREF(newrt); - if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RUNLOCK(rh); - return (newrt); - - } else if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RUNLOCK(rh); - /* - * Either we hit the root or could not find any match, - * which basically means: "cannot get there from here". - */ -miss: - RTSTAT_INC(rts_unreach); - - if (report) { - /* - * If required, report the failure to the supervising - * Authorities. - * For a delete, this is not an error. (report == 0) - */ - bzero(&info, sizeof(info)); - info.rti_info[RTAX_DST] = dst; - rt_missmsg_fib(msgtype, &info, 0, err, fibnum); - } - return (newrt); -} - -/* * Remove a reference count from an rtentry. * If the count gets low enough, take it out of the routing table */ Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun May 10 03:36:11 2020 (r360865) +++ head/sys/net/route.h Sun May 10 09:34:48 2020 (r360866) @@ -392,8 +392,6 @@ struct sockaddr *rtsock_fix_netmask(const struct socka /* * Note the following locking behavior: * - * rtalloc1() returns a locked rtentry - * * rtfree() and RTFREE_LOCKED() require a locked rtentry * * RTFREE() uses an unlocked entry. @@ -414,14 +412,12 @@ void rt_flushifroutes(struct ifnet *ifp); /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */ /* Thes are used by old code not yet converted to use multiple FIBS */ -struct rtentry *rtalloc1(struct sockaddr *, int, u_long); int rtinit(struct ifaddr *, int, int); /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones * but this will change.. */ -struct rtentry *rtalloc1_fib(struct sockaddr *, int, u_long, u_int); int rtioctl_fib(u_long, caddr_t, u_int); int rtrequest_fib(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int);