diff options
| author | vivek <vivek@cumulusnetworks.com> | 2018-03-10 04:03:41 +0000 |
|---|---|---|
| committer | vivek <vivek@cumulusnetworks.com> | 2018-03-10 04:03:41 +0000 |
| commit | 4e262455a252c700f81df75fb8107d112062bba8 (patch) | |
| tree | fbd55c66eebe78ccb60424e560548d1613aa403a /sharpd/sharp_zebra.c | |
| parent | bfd498f0dab9a1937c6036cd35ed020b64a69e8f (diff) | |
| parent | 58e7db106d5907cb129fcc316f02ce0bf34e3885 (diff) | |
Merge branch 'master' of https://github.com/frrouting/frr into evpn-ipv6-tenant-routing
Conflicts:
bgpd/bgp_evpn.c
Diffstat (limited to 'sharpd/sharp_zebra.c')
| -rw-r--r-- | sharpd/sharp_zebra.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index f02ce4979c..8915397c7e 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -56,7 +56,7 @@ static struct interface *zebra_interface_if_lookup(struct stream *s) /* Inteface addition message from zebra. */ static int interface_add(int command, struct zclient *zclient, - zebra_size_t length, vrf_id_t vrf_id) + zebra_size_t length, vrf_id_t vrf_id) { struct interface *ifp; @@ -130,6 +130,7 @@ static int interface_state_down(int command, struct zclient *zclient, extern uint32_t total_routes; extern uint32_t installed_routes; +extern uint32_t removed_routes; static int route_notify_owner(int command, struct zclient *zclient, zebra_size_t length, vrf_id_t vrf_id) @@ -141,10 +142,27 @@ static int route_notify_owner(int command, struct zclient *zclient, if (!zapi_route_notify_decode(zclient->ibuf, &p, &table, ¬e)) return -1; - installed_routes++; - - if (total_routes == installed_routes) - zlog_debug("Installed All Items"); + switch (note) { + case ZAPI_ROUTE_INSTALLED: + installed_routes++; + if (total_routes == installed_routes) + zlog_debug("Installed All Items"); + break; + case ZAPI_ROUTE_FAIL_INSTALL: + zlog_debug("Failed install of route"); + break; + case ZAPI_ROUTE_BETTER_ADMIN_WON: + zlog_debug("Better Admin Distance won over us"); + break; + case ZAPI_ROUTE_REMOVED: + removed_routes++; + if (total_routes == removed_routes) + zlog_debug("Removed all Items"); + break; + case ZAPI_ROUTE_REMOVE_FAIL: + zlog_debug("Route removal Failure"); + break; + } return 0; } @@ -200,7 +218,7 @@ extern struct zebra_privs_t sharp_privs; void sharp_zebra_init(void) { - struct zclient_options opt = { .receive_notify = true }; + struct zclient_options opt = {.receive_notify = true}; zclient = zclient_new_notify(master, &opt); |
