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
This commit is contained in:
parent
b8aa77b74d
commit
d223372545
@ -419,76 +419,6 @@ sys_setfib(struct thread *td, struct setfib_args *uap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
@ -392,8 +392,6 @@ struct sockaddr *rtsock_fix_netmask(const struct sockaddr *dst,
|
||||
/*
|
||||
* 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);
|
||||
|
Loading…
Reference in New Issue
Block a user