From: Mark Stapp Date: Tue, 25 Feb 2020 13:26:38 +0000 (-0500) Subject: lib: use const in nexthop_group copy api X-Git-Tag: base_7.4~316^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c13bfa74357bdcb719a648b18019dd1151191c10;p=matthieu%2Ffrr.git lib: use const in nexthop_group copy api Add some const to the nhg copy api. Signed-off-by: Mark Stapp --- diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index 3005a51c71..d660428bcd 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -216,7 +216,8 @@ struct nexthop_group *nexthop_group_new(void) return XCALLOC(MTYPE_NEXTHOP_GROUP, sizeof(struct nexthop_group)); } -void nexthop_group_copy(struct nexthop_group *to, struct nexthop_group *from) +void nexthop_group_copy(struct nexthop_group *to, + const struct nexthop_group *from) { /* Copy everything, including recursive info */ copy_nexthops(&to->nexthop, from->nexthop, NULL); diff --git a/lib/nexthop_group.h b/lib/nexthop_group.h index 73b020283a..f99a53f694 100644 --- a/lib/nexthop_group.h +++ b/lib/nexthop_group.h @@ -43,7 +43,7 @@ struct nexthop_group *nexthop_group_new(void); void nexthop_group_delete(struct nexthop_group **nhg); void nexthop_group_copy(struct nexthop_group *to, - struct nexthop_group *from); + const struct nexthop_group *from); /* * Copy a list of nexthops in 'nh' to an nhg, enforcing canonical sort order