Date: Sun, 10 May 2020 09:34:49 +0000 (UTC) From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360866 - head/sys/net Message-ID: <202005100934.04A9YnB5006386@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005100934.04A9YnB5006386>