summaryrefslogtreecommitdiffstats
path: root/staticd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-07-16 13:31:18 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-07-16 13:59:22 +0200
commit6f5db0b1ab243faf32be5729958fbb15c37c9496 (patch)
tree5acf345ea7b99e5dd56960074b6e0523bf5ff204 /staticd
parentstaticd: Fix static_nht_update to actually know route we are installing (diff)
downloadfrr-6f5db0b1ab243faf32be5729958fbb15c37c9496.tar.xz
frr-6f5db0b1ab243faf32be5729958fbb15c37c9496.zip
staticd: Setup nexthop tracking instead of installing route
Route installs should be handled by the setup of nexthop tracking instead of installing the route and then installing the nexthop tracking again ( and reinstalling the route ) This change makes routes be installed one time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_routes.c2
-rw-r--r--staticd/static_zebra.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/staticd/static_routes.c b/staticd/static_routes.c
index a6d4c1806..b2c61bcba 100644
--- a/staticd/static_routes.c
+++ b/staticd/static_routes.c
@@ -183,7 +183,7 @@ int static_add_route(afi_t afi, safi_t safi, uint8_t type, struct prefix *p,
/* check whether interface exists in system & install if it does */
if (!ifname)
- static_install_route(rn, si, safi);
+ static_zebra_nht_register(rn, si, true);
else {
struct interface *ifp;
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index 65d8e6fb9..ad275d1f1 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -43,6 +43,8 @@
#include "static_nht.h"
#include "static_vty.h"
+bool debug;
+
/* Zebra structure to hold current status. */
struct zclient *zclient;
static struct hash *static_nht_hash;
@@ -316,7 +318,10 @@ void static_zebra_nht_register(struct route_node *rn,
static_nht_hash_alloc);
nhtd->refcount++;
- if (nhtd->refcount > 1) {
+ if (debug)
+ zlog_debug("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, si->nh_vrf_id);
return;