summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/nexthop.c9
-rw-r--r--lib/nexthop.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c
index ac22e7ec84..98b05295b9 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -713,6 +713,15 @@ struct nexthop *nexthop_next(const struct nexthop *nexthop)
return NULL;
}
+struct nexthop *nexthop_next_resolution(const struct nexthop *nexthop,
+ bool nexthop_resolution)
+{
+ if (nexthop_resolution)
+ return nexthop_next(nexthop);
+ /* no resolution attempt */
+ return nexthop->next;
+}
+
/* Return the next nexthop in the tree that is resolved and active */
struct nexthop *nexthop_next_active_resolved(const struct nexthop *nexthop)
{
diff --git a/lib/nexthop.h b/lib/nexthop.h
index 15cfb26d82..02ea4d96f2 100644
--- a/lib/nexthop.h
+++ b/lib/nexthop.h
@@ -225,6 +225,8 @@ extern bool nexthop_labels_match(const struct nexthop *nh1,
extern const char *nexthop2str(const struct nexthop *nexthop,
char *str, int size);
extern struct nexthop *nexthop_next(const struct nexthop *nexthop);
+extern struct nexthop *nexthop_next_resolution(const struct nexthop *nexthop,
+ bool nexthop_resolution);
extern struct nexthop *
nexthop_next_active_resolved(const struct nexthop *nexthop);
extern unsigned int nexthop_level(const struct nexthop *nexthop);