diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-08-09 08:01:06 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2021-08-09 08:06:33 -0400 |
| commit | 38c764dde42b605e12a35d3bcb5b93cf72272d30 (patch) | |
| tree | 31e90d3cb8e321f37449e26d9ba3bbe83904682d /zebra/zebra_rib.c | |
| parent | f94a7703c0725766f7dd91931718d3869ed28116 (diff) | |
zebra: Properly note add/update for rib_add_multipath_nhe
When calling rib_add_multipath_nhe ensure that we have
well aligned return codes that mean something so that
interersted parties can properly handle the situation.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index c51dd759a6..2ed025857d 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3453,6 +3453,10 @@ void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id) * allocate: if they allocate a nexthop_group or backup nexthop info, they * must free those objects. If this returns < 0, an error has occurred and the * route_entry 're' has not been captured; the caller should free that also. + * + * -1 -> error + * 0 -> Add + * 1 -> update */ int rib_add_multipath_nhe(afi_t afi, safi_t safi, struct prefix *p, struct prefix_ipv6 *src_p, struct route_entry *re, @@ -3567,11 +3571,12 @@ int rib_add_multipath_nhe(afi_t afi, safi_t safi, struct prefix *p, SET_FLAG(re->status, ROUTE_ENTRY_CHANGED); rib_addnode(rn, re, 1); - ret = 1; /* Free implicit route.*/ - if (same) + if (same) { + ret = 1; rib_delnode(rn, same); + } /* See if we can remove some RE entries that are queued for * removal, but won't be considered in rib processing. |
