mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 09:20:25 +00:00
staticd: register to interface events related with non default vrf
in addition to non default vrf, once a new vrf is available, the static daemon registers to events from that vrf, including presence of interfaces. this permits to create static route with nexthop=interface. Reversely, an unregistration is scheduled too when vrf disappears. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
215e03fe53
commit
fceb6174cf
@ -27,6 +27,7 @@
|
|||||||
#include "static_memory.h"
|
#include "static_memory.h"
|
||||||
#include "static_vrf.h"
|
#include "static_vrf.h"
|
||||||
#include "static_routes.h"
|
#include "static_routes.h"
|
||||||
|
#include "static_zebra.h"
|
||||||
#include "static_vty.h"
|
#include "static_vty.h"
|
||||||
|
|
||||||
static void zebra_stable_node_cleanup(struct route_table *table,
|
static void zebra_stable_node_cleanup(struct route_table *table,
|
||||||
@ -76,6 +77,8 @@ static int static_vrf_new(struct vrf *vrf)
|
|||||||
|
|
||||||
static int static_vrf_enable(struct vrf *vrf)
|
static int static_vrf_enable(struct vrf *vrf)
|
||||||
{
|
{
|
||||||
|
static_zebra_vrf_register(vrf);
|
||||||
|
|
||||||
static_fixup_vrf_ids(vrf->info);
|
static_fixup_vrf_ids(vrf->info);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -89,6 +92,7 @@ static int static_vrf_enable(struct vrf *vrf)
|
|||||||
|
|
||||||
static int static_vrf_disable(struct vrf *vrf)
|
static int static_vrf_disable(struct vrf *vrf)
|
||||||
{
|
{
|
||||||
|
static_zebra_vrf_unregister(vrf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,3 +526,17 @@ void static_zebra_init(void)
|
|||||||
static_nht_hash_cmp,
|
static_nht_hash_cmp,
|
||||||
"Static Nexthop Tracking hash");
|
"Static Nexthop Tracking hash");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void static_zebra_vrf_register(struct vrf *vrf)
|
||||||
|
{
|
||||||
|
if (vrf->vrf_id == VRF_DEFAULT)
|
||||||
|
return;
|
||||||
|
zclient_send_reg_requests(zclient, vrf->vrf_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void static_zebra_vrf_unregister(struct vrf *vrf)
|
||||||
|
{
|
||||||
|
if (vrf->vrf_id == VRF_DEFAULT)
|
||||||
|
return;
|
||||||
|
zclient_send_dereg_requests(zclient, vrf->vrf_id);
|
||||||
|
}
|
||||||
|
@ -28,4 +28,7 @@ extern void static_zebra_route_add(struct route_node *rn,
|
|||||||
struct static_route *si_changed,
|
struct static_route *si_changed,
|
||||||
vrf_id_t vrf_id, safi_t safi, bool install);
|
vrf_id_t vrf_id, safi_t safi, bool install);
|
||||||
extern void static_zebra_init(void);
|
extern void static_zebra_init(void);
|
||||||
|
extern void static_zebra_vrf_register(struct vrf *vrf);
|
||||||
|
extern void static_zebra_vrf_unregister(struct vrf *vrf);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user