mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Use rn_match instead of doing indirect calls in fib_algo.
Relevant inet/inet6 code has the control over deciding what the RIB lookup function currently is. With that in mind, explicitly set it to the current value (rn_match) in the datapath lookups. This avoids cost on indirect call. Differential Revision: https://reviews.freebsd.org/D28066
This commit is contained in:
parent
4ea65707d3
commit
2defbe9f0e
2 changed files with 4 additions and 4 deletions
|
|
@ -521,7 +521,7 @@ lradix4_lookup(void *algo_data, const struct flm_lookup_key key, uint32_t scopei
|
|||
.sin_len = KEY_LEN_INET,
|
||||
.sin_addr = key.addr4,
|
||||
};
|
||||
ent = (struct radix4_addr_entry *)(rnh->rnh_matchaddr(&addr4, &rnh->rh));
|
||||
ent = (struct radix4_addr_entry *)(rn_match(&addr4, &rnh->rh));
|
||||
if (ent != NULL)
|
||||
return (ent->nhop);
|
||||
return (NULL);
|
||||
|
|
@ -680,7 +680,7 @@ radix4_lookup(void *algo_data, const struct flm_lookup_key key, uint32_t scopeid
|
|||
|
||||
nh = NULL;
|
||||
RIB_RLOCK(rh);
|
||||
rn = rh->rnh_matchaddr((void *)&sin4, &rh->head);
|
||||
rn = rn_match((void *)&sin4, &rh->head);
|
||||
if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0))
|
||||
nh = (RNTORT(rn))->rt_nhop;
|
||||
RIB_RUNLOCK(rh);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ lradix6_lookup(void *algo_data, const struct flm_lookup_key key, uint32_t scopei
|
|||
};
|
||||
if (IN6_IS_SCOPE_LINKLOCAL(key.addr6))
|
||||
addr6.sin6_addr.s6_addr16[1] = htons(scopeid & 0xffff);
|
||||
ent = (struct radix6_addr_entry *)(rnh->rnh_matchaddr(&addr6, &rnh->rh));
|
||||
ent = (struct radix6_addr_entry *)(rn_match(&addr6, &rnh->rh));
|
||||
if (ent != NULL)
|
||||
return (ent->nhop);
|
||||
return (NULL);
|
||||
|
|
@ -264,7 +264,7 @@ radix6_lookup(void *algo_data, const struct flm_lookup_key key, uint32_t scopeid
|
|||
|
||||
nh = NULL;
|
||||
RIB_RLOCK(rh);
|
||||
rn = rh->rnh_matchaddr((void *)&sin6, &rh->head);
|
||||
rn = rn_match((void *)&sin6, &rh->head);
|
||||
if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0))
|
||||
nh = (RNTORT(rn))->rt_nhop;
|
||||
RIB_RUNLOCK(rh);
|
||||
|
|
|
|||
Loading…
Reference in a new issue