summaryrefslogtreecommitdiffstats
path: root/sys/net/radix.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/radix.c')
-rw-r--r--sys/net/radix.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/net/radix.c b/sys/net/radix.c
index 0f718b7..030aa58 100644
--- a/sys/net/radix.c
+++ b/sys/net/radix.c
@@ -48,6 +48,13 @@
#include <net/radix.h>
#endif
+#include "opt_mpath.h"
+
+#ifdef RADIX_MPATH
+#include <net/radix_mpath.h>
+#endif
+
+
static int rn_walktree_from(struct radix_node_head *h, void *a, void *m,
walktree_f_t *f, void *w);
static int rn_walktree(struct radix_node_head *, walktree_f_t *, void *);
@@ -630,6 +637,21 @@ rn_addroute(v_arg, n_arg, head, treenodes)
saved_tt = tt = rn_insert(v, head, &keyduplicated, treenodes);
if (keyduplicated) {
for (t = tt; tt; t = tt, tt = tt->rn_dupedkey) {
+#ifdef RADIX_MPATH
+ /* permit multipath, if enabled for the family */
+ if (rn_mpath_capable(head) && netmask == tt->rn_mask) {
+ /*
+ * go down to the end of multipaths, so that
+ * new entry goes into the end of rn_dupedkey
+ * chain.
+ */
+ do {
+ t = tt;
+ tt = tt->rn_dupedkey;
+ } while (tt && t->rn_mask == tt->rn_mask);
+ break;
+ }
+#endif
if (tt->rn_mask == netmask)
return (0);
if (netmask == 0 ||
OpenPOWER on IntegriCloud