diff options
author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-23 20:37:20 +0200 |
---|---|---|
committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-25 17:13:44 +0200 |
commit | 17c25e0368e765ec23b7c94e65f5d4e44102f77e (patch) | |
tree | 36128bfd33ab2aa3697cfe2b3672797df4461ca3 /lib/nexthop.c | |
parent | zebra: Check depends for validity, not dependents (diff) | |
download | frr-17c25e0368e765ec23b7c94e65f5d4e44102f77e.tar.xz frr-17c25e0368e765ec23b7c94e65f5d4e44102f77e.zip |
lib: Make nexthop_next* use const for nexthop
Make nexthop_next() and nexthop_next_active_resolved() use
const for the nexthop argument. They should not be modifying so
it makes sense here.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'lib/nexthop.c')
-rw-r--r-- | lib/nexthop.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c index 017131882..73c2de0cd 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c @@ -349,7 +349,7 @@ const char *nexthop2str(const struct nexthop *nexthop, char *str, int size) * left branch is 'resolved' and right branch is 'next': * https://en.wikipedia.org/wiki/Tree_traversal#/media/File:Sorted_binary_tree_preorder.svg */ -struct nexthop *nexthop_next(struct nexthop *nexthop) +struct nexthop *nexthop_next(const struct nexthop *nexthop) { if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE)) return nexthop->resolved; @@ -365,7 +365,7 @@ struct nexthop *nexthop_next(struct nexthop *nexthop) } /* Return the next nexthop in the tree that is resolved and active */ -struct nexthop *nexthop_next_active_resolved(struct nexthop *nexthop) +struct nexthop *nexthop_next_active_resolved(const struct nexthop *nexthop) { struct nexthop *next = nexthop_next(nexthop); |