Skip to content

Commit

Permalink
Merge pull request #16630 from donaldsharp/babel_metric
Browse files Browse the repository at this point in the history
Babel metric
  • Loading branch information
mjstapp authored Aug 22, 2024
2 parents 05c17ef + 63e2c09 commit 44e8a95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions babeld/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,9 @@ kernel_route(enum babel_kernel_routes operation, const unsigned char *pref,
case ROUTE_MODIFY:
if(newmetric == metric && memcmp(newgate, gate, 16) == 0 &&
newifindex == ifindex)
return 0;
debugf(BABEL_DEBUG_ROUTE, "Modify route: delete old; add new.");
rc = zebra_route(0, family, pref, plen, gate, ifindex, metric);
if (rc < 0)
return -1;
return 0;

rc = zebra_route(1, family, pref, plen, newgate, newifindex,
rc = zebra_route(1, family, pref, plen, newgate, newifindex,
newmetric);
return rc;
}
Expand Down
2 changes: 1 addition & 1 deletion babeld/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ route_stream_done(struct route_stream *stream)
static int
metric_to_kernel(int metric)
{
return metric < INFINITY ? kernel_metric : KERNEL_INFINITY;
return metric < INFINITY ? metric : KERNEL_INFINITY;
}

/* This is used to maintain the invariant that the installed route is at
Expand Down

0 comments on commit 44e8a95

Please sign in to comment.