diff options
Diffstat (limited to 'zebra/zapi_msg.c')
| -rw-r--r-- | zebra/zapi_msg.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 951a411f25..3bf03039b1 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -42,6 +42,7 @@ #include "lib/libfrr.h" #include "lib/sockopt.h" +#include "zebra/zebra_router.h" #include "zebra/rib.h" #include "zebra/zebra_memory.h" #include "zebra/zebra_ns.h" @@ -208,12 +209,6 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp) { struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); - /* Check this client need interface information. */ - if (!vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) { - stream_free(s); - return 0; - } - if (!ifp->link_params) { stream_free(s); return 0; @@ -365,7 +360,7 @@ static void zebra_interface_nbr_address_add_update(struct interface *ifp, p->prefixlen, ifc->ifp->name); } - for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) + for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) zsend_interface_nbr_address(ZEBRA_INTERFACE_NBR_ADDRESS_ADD, client, ifp, ifc); } @@ -389,7 +384,7 @@ static void zebra_interface_nbr_address_delete_update(struct interface *ifp, p->prefixlen, ifc->ifp->name); } - for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) + for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) zsend_interface_nbr_address(ZEBRA_INTERFACE_NBR_ADDRESS_DELETE, client, ifp, ifc); } @@ -768,7 +763,7 @@ void zsend_rule_notify_owner(struct zebra_pbr_rule *rule, zlog_debug("%s: Notifying %u", __PRETTY_FUNCTION__, rule->rule.unique); - for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) { + for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) { if (rule->sock == client->sock) break; } @@ -804,7 +799,7 @@ void zsend_ipset_notify_owner(struct zebra_pbr_ipset *ipset, zlog_debug("%s: Notifying %u", __PRETTY_FUNCTION__, ipset->unique); - for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) { + for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) { if (ipset->sock == client->sock) break; } @@ -834,7 +829,7 @@ void zsend_ipset_entry_notify_owner(struct zebra_pbr_ipset_entry *ipset, zlog_debug("%s: Notifying %u", __PRETTY_FUNCTION__, ipset->unique); - for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) { + for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) { if (ipset->sock == client->sock) break; } @@ -864,7 +859,7 @@ void zsend_iptable_notify_owner(struct zebra_pbr_iptable *iptable, zlog_debug("%s: Notifying %u", __PRETTY_FUNCTION__, iptable->unique); - for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) { + for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) { if (iptable->sock == client->sock) break; } @@ -1316,9 +1311,6 @@ static void zread_interface_add(ZAPI_HANDLER_ARGS) struct vrf *vrf; struct interface *ifp; - /* Interface information is needed. */ - vrf_bitmap_set(client->ifinfo, zvrf_id(zvrf)); - RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) { FOR_ALL_INTERFACES (vrf, ifp) { /* Skip pseudo interface. */ @@ -1335,7 +1327,6 @@ static void zread_interface_add(ZAPI_HANDLER_ARGS) /* Unregister zebra server interface information. */ static void zread_interface_delete(ZAPI_HANDLER_ARGS) { - vrf_bitmap_unset(client->ifinfo, zvrf_id(zvrf)); } void zserv_nexthop_num_warn(const char *caller, const struct prefix *p, @@ -1674,6 +1665,18 @@ static void zsend_capabilities(struct zserv *client, struct zebra_vrf *zvrf) zserv_send_message(client, s); } +void zsend_capabilities_all_clients(void) +{ + struct listnode *node, *nnode; + struct zebra_vrf *zvrf; + struct zserv *client; + + zvrf = vrf_info_lookup(VRF_DEFAULT); + for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) { + zsend_capabilities(client, zvrf); + } +} + /* Tie up route-type and client->sock */ static void zread_hello(ZAPI_HANDLER_ARGS) { @@ -1718,7 +1721,6 @@ static void zread_vrf_unregister(ZAPI_HANDLER_ARGS) vrf_bitmap_unset(client->redist[afi][i], zvrf_id(zvrf)); vrf_bitmap_unset(client->redist_default[afi], zvrf_id(zvrf)); } - vrf_bitmap_unset(client->ifinfo, zvrf_id(zvrf)); vrf_bitmap_unset(client->ridinfo, zvrf_id(zvrf)); } |
