Merge pull request #5616 from sworleys/NHG-Fix-Recurse-to-Group

zebra: just set nexthop member in handle_recursive_depend()
This commit is contained in:
Mark Stapp 2020-01-15 16:26:06 -05:00 committed by GitHub
commit a67b69c024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -250,8 +250,7 @@ static void _nexthop_add_sorted(struct nexthop **head,
{
struct nexthop *position, *prev;
/* Ensure this gets set */
nexthop->next = NULL;
assert(!nexthop->next);
for (position = *head, prev = NULL; position;
prev = position, position = position->next) {
@ -281,6 +280,8 @@ void nexthop_group_add_sorted(struct nexthop_group *nhg,
{
struct nexthop *tail;
assert(!nexthop->next);
/* Try to just append to the end first;
* trust the list is already sorted
*/

View File

@ -478,7 +478,7 @@ static void handle_recursive_depend(struct nhg_connected_tree_head *nhg_depends,
struct nhg_hash_entry *depend = NULL;
struct nexthop_group resolved_ng = {};
nexthop_group_add_sorted(&resolved_ng, nh);
resolved_ng.nexthop = nh;
depend = zebra_nhg_rib_find(0, &resolved_ng, afi);
depends_add(nhg_depends, depend);