summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2016-01-11 08:45:28 +0000
committermelifaro <melifaro@FreeBSD.org>2016-01-11 08:45:28 +0000
commit7cc47d54cd4ddb0ff54ff3313eaa330dbd3fc5cb (patch)
treee477df88843816bf8af910b6e7fdade5396d26ad /sys/netinet
parent2d1014754e397b39dc0c8c0e2c63571bdd7faa2b (diff)
downloadFreeBSD-src-7cc47d54cd4ddb0ff54ff3313eaa330dbd3fc5cb.zip
FreeBSD-src-7cc47d54cd4ddb0ff54ff3313eaa330dbd3fc5cb.tar.gz
Bring RADIX_MPATH support to new routing KPI to ease migration.
Move actual rte selection process from rtalloc_mpath_fib() to the rt_path_selectrte() function. Add public rt_mpath_select() to use in fibX_lookup_ functions.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_fib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netinet/in_fib.c b/sys/netinet/in_fib.c
index 451b3747..352c6d0 100644
--- a/sys/netinet/in_fib.c
+++ b/sys/netinet/in_fib.c
@@ -200,6 +200,13 @@ fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flags,
rn = rh->rnh_matchaddr((void *)&sin, rh);
if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) {
rte = RNTORT(rn);
+#ifdef RADIX_MPATH
+ rte = rt_mpath_select(rte, flowid);
+ if (rte == NULL) {
+ RADIX_NODE_HEAD_RUNLOCK(rh);
+ return (ENOENT);
+ }
+#endif
/* Ensure route & ifp is UP */
if (RT_LINK_IS_UP(rte->rt_ifp)) {
fib4_rte_to_nh_extended(rte, dst, flags, pnh4);
OpenPOWER on IntegriCloud