diff options
Diffstat (limited to 'zebra/zserv.c')
| -rw-r--r-- | zebra/zserv.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index da52f93a28..18076fb62d 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -599,9 +599,11 @@ zsend_interface_update (int cmd, struct zserv *client, struct interface *ifp) * all the nexthops. */ int -zsend_redistribute_route (int cmd, struct zserv *client, struct prefix *p, +zsend_redistribute_route (int add, struct zserv *client, struct prefix *p, struct rib *rib) { + afi_t afi; + int cmd; int psize; struct stream *s; struct nexthop *nexthop; @@ -610,6 +612,40 @@ zsend_redistribute_route (int cmd, struct zserv *client, struct prefix *p, u_char zapi_flags = 0; struct nexthop dummy_nh; + afi = family2afi (p->family); + if (add) + { + switch (afi) + { + case AFI_IP: + cmd = ZEBRA_REDISTRIBUTE_IPV4_ADD; + client->redist_v4_add_cnt++; + break; + case AFI_IP6: + cmd = ZEBRA_REDISTRIBUTE_IPV6_ADD; + client->redist_v6_add_cnt++; + break; + default: + return -1; + } + } + else + { + switch (afi) + { + case AFI_IP: + cmd = ZEBRA_REDISTRIBUTE_IPV4_DEL; + client->redist_v4_del_cnt++; + break; + case AFI_IP6: + cmd = ZEBRA_REDISTRIBUTE_IPV6_DEL; + client->redist_v6_del_cnt++; + break; + default: + return -1; + } + } + /* Came from VRF lib patch, is this really needed? callers of this routine do check for redist.., so may be its not needed. Check this client need this route. |
