mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 15:07:51 +00:00
zebra: fix checking of clients subscribed to receive interface info
client->ifinfo is a VRF bitmap, hence we need to use vrf_bitmap_check() to check if a client is subscribed to receive interface information for a particular VRF. Just checking if the client->ifinfo value is set will always succeed since it's a pointer initialized by zserv_client_create(). With this fix, we'll stop sending interface messages from all VRFs to all clients, even those that didn't subscribe to it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
70fc94ca1d
commit
f20b478ef3
@ -405,7 +405,7 @@ void zebra_interface_up_update(struct interface *ifp)
|
|||||||
|
|
||||||
if (ifp->ptm_status || !ifp->ptm_enable) {
|
if (ifp->ptm_status || !ifp->ptm_enable) {
|
||||||
for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
|
for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
|
||||||
if (client->ifinfo) {
|
if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
|
||||||
zsend_interface_update(ZEBRA_INTERFACE_UP,
|
zsend_interface_update(ZEBRA_INTERFACE_UP,
|
||||||
client, ifp);
|
client, ifp);
|
||||||
zsend_interface_link_params(client, ifp);
|
zsend_interface_link_params(client, ifp);
|
||||||
@ -439,7 +439,7 @@ void zebra_interface_add_update(struct interface *ifp)
|
|||||||
ifp->vrf_id);
|
ifp->vrf_id);
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
|
for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
|
||||||
if (client->ifinfo) {
|
if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
|
||||||
client->ifadd_cnt++;
|
client->ifadd_cnt++;
|
||||||
zsend_interface_add(client, ifp);
|
zsend_interface_add(client, ifp);
|
||||||
zsend_interface_link_params(client, ifp);
|
zsend_interface_link_params(client, ifp);
|
||||||
@ -812,6 +812,6 @@ void zebra_interface_parameters_update(struct interface *ifp)
|
|||||||
ifp->name, ifp->vrf_id);
|
ifp->name, ifp->vrf_id);
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
|
for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
|
||||||
if (client->ifinfo)
|
if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id))
|
||||||
zsend_interface_link_params(client, ifp);
|
zsend_interface_link_params(client, ifp);
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp)
|
|||||||
struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ);
|
struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ);
|
||||||
|
|
||||||
/* Check this client need interface information. */
|
/* Check this client need interface information. */
|
||||||
if (!client->ifinfo) {
|
if (!vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
|
||||||
stream_free(s);
|
stream_free(s);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ static int zsend_interface_bfd_update(int cmd, struct zserv *client,
|
|||||||
struct stream *s;
|
struct stream *s;
|
||||||
|
|
||||||
/* Check this client need interface information. */
|
/* Check this client need interface information. */
|
||||||
if (!client->ifinfo)
|
if (!vrf_bitmap_check(client->ifinfo, ifp->vrf_id))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
s = stream_new(ZEBRA_MAX_PACKET_SIZ);
|
s = stream_new(ZEBRA_MAX_PACKET_SIZ);
|
||||||
|
Loading…
Reference in New Issue
Block a user