mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-24 16:26:43 +00:00
isisd: deregister vrf from zebra when vrf is disabled
Currently the VRF is deregistered only when it is re-enabled again. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
a63273a5b4
commit
164ab8965e
@ -724,6 +724,18 @@ void isis_zebra_vrf_register(struct isis *isis)
|
||||
}
|
||||
}
|
||||
|
||||
void isis_zebra_vrf_deregister(struct isis *isis)
|
||||
{
|
||||
if (!zclient || zclient->sock < 0 || !isis)
|
||||
return;
|
||||
|
||||
if (isis->vrf_id != VRF_UNKNOWN) {
|
||||
if (IS_DEBUG_EVENTS)
|
||||
zlog_debug("%s: Deregister VRF %s id %u", __func__,
|
||||
isis->name, isis->vrf_id);
|
||||
zclient_send_dereg_requests(zclient, isis->vrf_id);
|
||||
}
|
||||
}
|
||||
|
||||
static void isis_zebra_connected(struct zclient *zclient)
|
||||
{
|
||||
|
||||
@ -66,5 +66,6 @@ int isis_zebra_label_manager_connect(void);
|
||||
int isis_zebra_request_label_range(uint32_t base, uint32_t chunk_size);
|
||||
int isis_zebra_release_label_range(uint32_t start, uint32_t end);
|
||||
void isis_zebra_vrf_register(struct isis *isis);
|
||||
void isis_zebra_vrf_deregister(struct isis *isis);
|
||||
|
||||
#endif /* _ZEBRA_ISIS_ZEBRA_H */
|
||||
|
||||
@ -614,13 +614,8 @@ static int isis_vrf_enable(struct vrf *vrf)
|
||||
"%s: isis linked to vrf %s vrf_id %u (old id %u)",
|
||||
__func__, vrf->name, isis->vrf_id, old_vrf_id);
|
||||
if (old_vrf_id != isis->vrf_id) {
|
||||
frr_with_privs (&isisd_privs) {
|
||||
/* stop zebra redist to us for old vrf */
|
||||
zclient_send_dereg_requests(zclient,
|
||||
old_vrf_id);
|
||||
/* start zebra redist to us for new vrf */
|
||||
isis_zebra_vrf_register(isis);
|
||||
}
|
||||
/* start zebra redist to us for new vrf */
|
||||
isis_zebra_vrf_register(isis);
|
||||
}
|
||||
}
|
||||
|
||||
@ -642,6 +637,8 @@ static int isis_vrf_disable(struct vrf *vrf)
|
||||
if (isis) {
|
||||
old_vrf_id = isis->vrf_id;
|
||||
|
||||
isis_zebra_vrf_deregister(isis);
|
||||
|
||||
/* We have instance configured, unlink
|
||||
* from VRF and make it "down".
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user