diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-10-20 18:31:49 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-10-20 18:31:49 +0200 |
commit | 0a538fc98fb662b4cf2d927ac29fd9af4a4fab03 (patch) | |
tree | f6dbe2af92d44f9a77e4802cefb440811dd69584 /zebra/zserv.c | |
parent | Merge branch 'cmaster-next' into vtysh-grammar (diff) | |
parent | lib: Fix redist memory free'ing (diff) | |
download | frr-0a538fc98fb662b4cf2d927ac29fd9af4a4fab03.tar.xz frr-0a538fc98fb662b4cf2d927ac29fd9af4a4fab03.zip |
Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Conflicts:
isisd/isis_routemap.c
zebra/rt_netlink.c
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r-- | zebra/zserv.c | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index a0f46aadc..cb396942a 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,15 +612,39 @@ zsend_redistribute_route (int cmd, struct zserv *client, struct prefix *p, u_char zapi_flags = 0; struct nexthop dummy_nh; - /* 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. - if (!vrf_bitmap_check (client->redist[family2afi(p->family)][rib->type], - rib->vrf_id) && - !(is_default (p) && - vrf_bitmap_check (client->redist_default, rib->vrf_id))) - return 0; - */ + 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; + } + } s = client->obuf; stream_reset (s); |