summaryrefslogtreecommitdiff
path: root/staticd/static_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'staticd/static_zebra.c')
-rw-r--r--staticd/static_zebra.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index b75e1a1cdf..f937492ec2 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -47,6 +47,7 @@
/* Zebra structure to hold current status. */
struct zclient *zclient;
static struct hash *static_nht_hash;
+uint32_t zebra_ecmp_count = MULTIPATH_NUM;
/* Inteface addition message from zebra. */
static int static_ifp_create(struct interface *ifp)
@@ -302,12 +303,14 @@ void static_zebra_nht_register(struct static_nexthop *nh, bool reg)
static_nht_hash_alloc);
nhtd->refcount++;
- DEBUGD(&static_dbg_route,
- "Registered nexthop(%pFX) for %pRN %d", &p, rn,
- nhtd->nh_num);
- if (nhtd->refcount > 1 && nhtd->nh_num) {
- static_nht_update(&rn->p, nhtd->nh, nhtd->nh_num, afi,
- nh->nh_vrf_id);
+ if (nhtd->refcount > 1) {
+ DEBUGD(&static_dbg_route,
+ "Already registered nexthop(%pFX) for %pRN %d",
+ &p, rn, nhtd->nh_num);
+ if (nhtd->nh_num)
+ static_nht_update(&rn->p, nhtd->nh,
+ nhtd->nh_num, afi,
+ nh->nh_vrf_id);
return;
}
} else {
@@ -323,6 +326,9 @@ void static_zebra_nht_register(struct static_nexthop *nh, bool reg)
static_nht_hash_free(nhtd);
}
+ DEBUGD(&static_dbg_route, "%s nexthop(%pFX) for %pRN",
+ reg ? "Registering" : "Unregistering", &p, rn);
+
if (zclient_send_rnh(zclient, cmd, &p, false, false, nh->nh_vrf_id)
== ZCLIENT_SEND_FAILURE)
zlog_warn("%s: Failure to send nexthop to zebra", __func__);