]> git.puffer.fish Git - mirror/frr.git/commitdiff
libs: use const in copy_nexthops api 4080/head
authorMark Stapp <mjs@voltanet.io>
Thu, 4 Apr 2019 14:54:10 +0000 (10:54 -0400)
committerMark Stapp <mjs@voltanet.io>
Thu, 4 Apr 2019 14:54:10 +0000 (10:54 -0400)
Use const for the source arg to copy_nexthops().

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/nexthop_group.c
lib/nexthop_group.h

index dbc333778593ca02d3fde497ade6082944400af6..5fb4ea5234f0f489f32178e4ed72dcf41f07b6d4 100644 (file)
@@ -118,11 +118,11 @@ void nexthop_del(struct nexthop_group *nhg, struct nexthop *nh)
        nh->next = NULL;
 }
 
-void copy_nexthops(struct nexthop **tnh, struct nexthop *nh,
+void copy_nexthops(struct nexthop **tnh, const struct nexthop *nh,
                   struct nexthop *rparent)
 {
        struct nexthop *nexthop;
-       struct nexthop *nh1;
+       const struct nexthop *nh1;
 
        for (nh1 = nh; nh1; nh1 = nh1->next) {
                nexthop = nexthop_new();
index c6e290eeeade11e184b676cc8ac6cd94234b7596..d96d0ab9f5d2f55c6008a2413f84f94c81cf9731 100644 (file)
@@ -44,7 +44,7 @@ void nexthop_group_delete(struct nexthop_group **nhg);
 
 void nexthop_add(struct nexthop **target, struct nexthop *nexthop);
 void nexthop_del(struct nexthop_group *nhg, struct nexthop *nexthop);
-void copy_nexthops(struct nexthop **tnh, struct nexthop *nh,
+void copy_nexthops(struct nexthop **tnh, const struct nexthop *nh,
                   struct nexthop *rparent);
 
 /* The following for loop allows to iterate over the nexthop