1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Remove RTF_RNH_LOCKED support from rtalloc1_fib().

Last caller using it was eliminated in r293471.

Sponsored by:	Yandex LLC
This commit is contained in:
Alexander V. Chernikov 2016-01-13 14:32:48 +00:00
parent fa89f69240
commit 0eb64f4e44
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293829
2 changed files with 6 additions and 17 deletions

View File

@ -409,7 +409,6 @@ rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags,
struct rtentry *newrt;
struct rt_addrinfo info;
int err = 0, msgtype = RTM_MISS;
int needlock;
KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum"));
rnh = rt_tables_get_rnh(fibnum, dst->sa_family);
@ -420,23 +419,16 @@ rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags,
/*
* Look up the address in the table for that Address Family
*/
needlock = !(ignflags & RTF_RNH_LOCKED);
if (needlock)
RADIX_NODE_HEAD_RLOCK(rnh);
#ifdef INVARIANTS
else
RADIX_NODE_HEAD_LOCK_ASSERT(rnh);
#endif
RADIX_NODE_HEAD_RLOCK(rnh);
rn = rnh->rnh_matchaddr(dst, rnh);
if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
newrt = RNTORT(rn);
RT_LOCK(newrt);
RT_ADDREF(newrt);
if (needlock)
RADIX_NODE_HEAD_RUNLOCK(rnh);
goto done;
RADIX_NODE_HEAD_RUNLOCK(rnh);
return (newrt);
} else if (needlock)
} else
RADIX_NODE_HEAD_RUNLOCK(rnh);
/*
@ -456,10 +448,7 @@ rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags,
bzero(&info, sizeof(info));
info.rti_info[RTAX_DST] = dst;
rt_missmsg_fib(msgtype, &info, 0, err, fibnum);
}
done:
if (newrt)
RT_LOCK_ASSERT(newrt);
}
return (newrt);
}

View File

@ -175,7 +175,7 @@ struct rtentry {
/* 0x8000000 and up unassigned */
#define RTF_STICKY 0x10000000 /* always route dst->src */
#define RTF_RNH_LOCKED 0x40000000 /* radix node head is locked */
#define RTF_RNH_LOCKED 0x40000000 /* unused */
#define RTF_GWFLAG_COMPAT 0x80000000 /* a compatibility bit for interacting
with existing routing apps */