]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Re-add tracking of redistribution events
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 22 Jun 2018 14:33:42 +0000 (10:33 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 27 Jun 2018 23:49:55 +0000 (19:49 -0400)
Somewhere along the way we lost the tracking of
redistribution events.  Put them back in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zapi_msg.c

index 853a83373dbdfdeeeb887977e999caacaa0eb755..6946c33accce3c11fcf06f75406f8f1e064c915f 100644 (file)
@@ -521,6 +521,7 @@ int zsend_redistribute_route(int cmd, struct zserv *client, struct prefix *p,
        struct zapi_nexthop *api_nh;
        struct nexthop *nexthop;
        int count = 0;
+       afi_t afi;
 
        memset(&api, 0, sizeof(api));
        api.vrf_id = re->vrf_id;
@@ -528,6 +529,24 @@ int zsend_redistribute_route(int cmd, struct zserv *client, struct prefix *p,
        api.instance = re->instance;
        api.flags = re->flags;
 
+       afi = family2afi(p->family);
+       switch (afi) {
+       case AFI_IP:
+               if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
+                       client->redist_v4_add_cnt++;
+               else
+                       client->redist_v4_del_cnt++;
+               break;
+       case AFI_IP6:
+               if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
+                       client->redist_v6_add_cnt++;
+               else
+                       client->redist_v6_del_cnt++;
+               break;
+       default:
+               break;
+       }
+
        /* Prefix. */
        api.prefix = *p;
        if (src_p) {