diff options
author | melifaro <melifaro@FreeBSD.org> | 2016-01-13 14:32:48 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2016-01-13 14:32:48 +0000 |
commit | 7fd2ccf67ef48340e0f68ca1f47798b23cef6afd (patch) | |
tree | 07e58abceaa62a147f2cc75b915280582f724cc2 /sys/net | |
parent | a2e2af2dec20c5a27e1362d2e7877e22fd50d600 (diff) | |
download | FreeBSD-src-7fd2ccf67ef48340e0f68ca1f47798b23cef6afd.zip FreeBSD-src-7fd2ccf67ef48340e0f68ca1f47798b23cef6afd.tar.gz |
Remove RTF_RNH_LOCKED support from rtalloc1_fib().
Last caller using it was eliminated in r293471.
Sponsored by: Yandex LLC
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/route.c | 21 | ||||
-rw-r--r-- | sys/net/route.h | 2 |
2 files changed, 6 insertions, 17 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 9698dd3..bcc56d9 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -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 @@ miss: 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); } diff --git a/sys/net/route.h b/sys/net/route.h index f30a72f..9ce2865 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -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 */ |