mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-02 22:51:15 +00:00
Merge pull request #3631 from opensourcerouting/zapi_fixes
Small zapi fixes
This commit is contained in:
commit
62b6a7e149
@ -241,7 +241,7 @@ Zebra Protocol Commands
|
||||
+------------------------------------+-------+
|
||||
| ZEBRA_INTERFACE_DISABLE_RADV | 42 |
|
||||
+------------------------------------+-------+
|
||||
| ZEBRA_IPV3_NEXTHOP_LOOKUP_MRIB | 44 |
|
||||
| ZEBRA_IPV3_NEXTHOP_LOOKUP_MRIB | 43 |
|
||||
+------------------------------------+-------+
|
||||
| ZEBRA_INTERFACE_LINK_PARAMS | 44 |
|
||||
+------------------------------------+-------+
|
||||
@ -279,9 +279,9 @@ Zebra Protocol Commands
|
||||
+------------------------------------+-------+
|
||||
| ZEBRA_VNI_DEL | 61 |
|
||||
+------------------------------------+-------+
|
||||
| ZEBRA_L2VNI_ADD | 63 |
|
||||
| ZEBRA_L3VNI_ADD | 62 |
|
||||
+------------------------------------+-------+
|
||||
| ZEBRA_L2VNI_DEL | 64 |
|
||||
| ZEBRA_L3VNI_DEL | 63 |
|
||||
+------------------------------------+-------+
|
||||
| ZEBRA_REMOTE_VTEP_ADD | 64 |
|
||||
+------------------------------------+-------+
|
||||
|
@ -219,11 +219,11 @@ static int isis_zebra_if_address_del(int command, struct zclient *client,
|
||||
}
|
||||
|
||||
static int isis_zebra_link_params(int command, struct zclient *zclient,
|
||||
zebra_size_t length)
|
||||
zebra_size_t length, vrf_id_t vrf_id)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
ifp = zebra_interface_link_params_read(zclient->ibuf);
|
||||
ifp = zebra_interface_link_params_read(zclient->ibuf, vrf_id);
|
||||
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
@ -457,8 +457,7 @@ void zclient_send_reg_requests(struct zclient *zclient, vrf_id_t vrf_id)
|
||||
vrf_id);
|
||||
|
||||
/* If default information is needed. */
|
||||
if (vrf_bitmap_check(zclient->default_information[afi],
|
||||
VRF_DEFAULT))
|
||||
if (vrf_bitmap_check(zclient->default_information[afi], vrf_id))
|
||||
zebra_redistribute_default_send(
|
||||
ZEBRA_REDISTRIBUTE_DEFAULT_ADD, zclient, afi,
|
||||
vrf_id);
|
||||
@ -525,8 +524,7 @@ void zclient_send_dereg_requests(struct zclient *zclient, vrf_id_t vrf_id)
|
||||
i, 0, vrf_id);
|
||||
|
||||
/* If default information is needed. */
|
||||
if (vrf_bitmap_check(zclient->default_information[afi],
|
||||
VRF_DEFAULT))
|
||||
if (vrf_bitmap_check(zclient->default_information[afi], vrf_id))
|
||||
zebra_redistribute_default_send(
|
||||
ZEBRA_REDISTRIBUTE_DEFAULT_DELETE, zclient, afi,
|
||||
vrf_id);
|
||||
@ -1497,7 +1495,8 @@ static void link_params_set_value(struct stream *s, struct if_link_params *iflp)
|
||||
iflp->use_bw = stream_getf(s);
|
||||
}
|
||||
|
||||
struct interface *zebra_interface_link_params_read(struct stream *s)
|
||||
struct interface *zebra_interface_link_params_read(struct stream *s,
|
||||
vrf_id_t vrf_id)
|
||||
{
|
||||
struct if_link_params *iflp;
|
||||
ifindex_t ifindex;
|
||||
@ -1506,7 +1505,7 @@ struct interface *zebra_interface_link_params_read(struct stream *s)
|
||||
|
||||
ifindex = stream_getl(s);
|
||||
|
||||
struct interface *ifp = if_lookup_by_index(ifindex, VRF_DEFAULT);
|
||||
struct interface *ifp = if_lookup_by_index(ifindex, vrf_id);
|
||||
|
||||
if (ifp == NULL) {
|
||||
flog_err(EC_LIB_ZAPI_ENCODE,
|
||||
@ -2583,7 +2582,7 @@ static int zclient_read(struct thread *thread)
|
||||
case ZEBRA_INTERFACE_LINK_PARAMS:
|
||||
if (zclient->interface_link_params)
|
||||
(*zclient->interface_link_params)(command, zclient,
|
||||
length);
|
||||
length, vrf_id);
|
||||
break;
|
||||
case ZEBRA_FEC_UPDATE:
|
||||
if (zclient_debug)
|
||||
|
@ -229,7 +229,7 @@ struct zclient {
|
||||
int (*interface_address_add)(int, struct zclient *, uint16_t, vrf_id_t);
|
||||
int (*interface_address_delete)(int, struct zclient *, uint16_t,
|
||||
vrf_id_t);
|
||||
int (*interface_link_params)(int, struct zclient *, uint16_t);
|
||||
int (*interface_link_params)(int, struct zclient *, uint16_t, vrf_id_t);
|
||||
int (*interface_bfd_dest_update)(int, struct zclient *, uint16_t,
|
||||
vrf_id_t);
|
||||
int (*interface_nbr_address_add)(int, struct zclient *, uint16_t,
|
||||
@ -564,7 +564,8 @@ extern struct interface *zebra_interface_vrf_update_read(struct stream *s,
|
||||
extern void zebra_interface_if_set_value(struct stream *, struct interface *);
|
||||
extern void zebra_router_id_update_read(struct stream *s, struct prefix *rid);
|
||||
|
||||
extern struct interface *zebra_interface_link_params_read(struct stream *);
|
||||
extern struct interface *zebra_interface_link_params_read(struct stream *s,
|
||||
vrf_id_t vrf_id);
|
||||
extern size_t zebra_interface_link_params_write(struct stream *,
|
||||
struct interface *);
|
||||
extern int zclient_send_get_label_chunk(
|
||||
|
@ -340,11 +340,11 @@ static int ospf_interface_address_delete(int command, struct zclient *zclient,
|
||||
}
|
||||
|
||||
static int ospf_interface_link_params(int command, struct zclient *zclient,
|
||||
zebra_size_t length)
|
||||
zebra_size_t length, vrf_id_t vrf_id)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
ifp = zebra_interface_link_params_read(zclient->ibuf);
|
||||
ifp = zebra_interface_link_params_read(zclient->ibuf, vrf_id);
|
||||
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
@ -405,7 +405,7 @@ void zebra_interface_up_update(struct interface *ifp)
|
||||
|
||||
if (ifp->ptm_status || !ifp->ptm_enable) {
|
||||
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,
|
||||
client, ifp);
|
||||
zsend_interface_link_params(client, ifp);
|
||||
@ -439,7 +439,7 @@ void zebra_interface_add_update(struct interface *ifp)
|
||||
ifp->vrf_id);
|
||||
|
||||
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++;
|
||||
zsend_interface_add(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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ 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 (!client->ifinfo) {
|
||||
if (!vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
|
||||
stream_free(s);
|
||||
return 0;
|
||||
}
|
||||
@ -1324,6 +1324,7 @@ static void zread_interface_add(ZAPI_HANDLER_ARGS)
|
||||
continue;
|
||||
|
||||
zsend_interface_add(client, ifp);
|
||||
zsend_interface_link_params(client, ifp);
|
||||
zsend_interface_addresses(client, ifp);
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ static int zsend_interface_bfd_update(int cmd, struct zserv *client,
|
||||
struct stream *s;
|
||||
|
||||
/* Check this client need interface information. */
|
||||
if (!client->ifinfo)
|
||||
if (!vrf_bitmap_check(client->ifinfo, ifp->vrf_id))
|
||||
return 0;
|
||||
|
||||
s = stream_new(ZEBRA_MAX_PACKET_SIZ);
|
||||
|
Loading…
Reference in New Issue
Block a user