diff options
| author | Russ White <russ@riw.us> | 2018-12-13 10:41:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-13 10:41:26 -0500 |
| commit | f4aaa039075548760cd5e619c5d241dc3bbae22c (patch) | |
| tree | 194b49e32aa86aee8b57b421081643be49605fab /zebra/zebra_rib.c | |
| parent | f1663c1eaefed315a6e614a5ecfccbf6ca0286b5 (diff) | |
| parent | 220f0f4245e36cd170bea79e501de43ac46e428a (diff) | |
Merge pull request #3477 from donaldsharp/multipath_respect
zebra: Allow zebra to only mark up to multipath_num nexthops as ACTIVE
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index c7ad2508fe..d628b801a5 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -971,7 +971,18 @@ static int nexthop_active_update(struct route_node *rn, struct route_entry *re, prev_src = nexthop->rmap_src; prev_active = CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE); prev_index = nexthop->ifindex; - if ((new_active = nexthop_active_check(rn, re, nexthop, set))) + /* + * We need to respect the multipath_num here + * as that what we should be able to install from + * a multipath perpsective should not be a data plane + * decision point. + */ + new_active = nexthop_active_check(rn, re, nexthop, set); + if (new_active && re->nexthop_active_num >= multipath_num) { + UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE); + new_active = 0; + } + if (new_active) re->nexthop_active_num++; /* Don't allow src setting on IPv6 addr for now */ if (prev_active != new_active || prev_index != nexthop->ifindex |
