mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 01:31:55 +00:00
L3VPN: Fix missing rte_owner_class registration
This commit is contained in:
parent
468f1d6547
commit
d2a531a92b
@ -338,6 +338,23 @@ l3vpn_rte_better(const rte *new, const rte *old)
|
||||
return rt_get_igp_metric(new) < rt_get_igp_metric(old);
|
||||
}
|
||||
|
||||
static void
|
||||
l3vpn_get_route_info(const rte *rte, byte *buf)
|
||||
{
|
||||
u32 pref = rt_get_preference(rte);
|
||||
u32 metric = rt_get_igp_metric(rte);
|
||||
|
||||
if (metric < IGP_METRIC_UNKNOWN)
|
||||
bsprintf(buf, " (%u/%u)", pref, metric);
|
||||
else
|
||||
bsprintf(buf, " (%u/?)", pref);
|
||||
}
|
||||
|
||||
static struct rte_owner_class l3vpn_rte_owner_class = {
|
||||
.get_route_info = l3vpn_get_route_info,
|
||||
.rte_better = l3vpn_rte_better,
|
||||
};
|
||||
|
||||
static void
|
||||
l3vpn_postconfig(struct proto_config *CF)
|
||||
{
|
||||
@ -395,6 +412,8 @@ l3vpn_init(struct proto_config *CF)
|
||||
P->preexport = l3vpn_preexport;
|
||||
P->reload_routes = l3vpn_reload_routes;
|
||||
|
||||
P->sources.class = &l3vpn_rte_owner_class;
|
||||
|
||||
return P;
|
||||
}
|
||||
|
||||
@ -483,23 +502,6 @@ l3vpn_copy_config(struct proto_config *dest UNUSED, struct proto_config *src UNU
|
||||
/* Just a shallow copy, not many items here */
|
||||
}
|
||||
|
||||
static void
|
||||
l3vpn_get_route_info(const rte *rte, byte *buf)
|
||||
{
|
||||
u32 metric = rt_get_igp_metric(rte);
|
||||
u32 pref = rt_get_preference(rte);
|
||||
|
||||
if (metric < IGP_METRIC_UNKNOWN)
|
||||
bsprintf(buf, " (%u/%u)", pref, metric);
|
||||
else
|
||||
bsprintf(buf, " (%u/?)", pref);
|
||||
}
|
||||
|
||||
struct rte_owner_class l3vpn_rte_owner_class = {
|
||||
.get_route_info = l3vpn_get_route_info,
|
||||
.rte_better = l3vpn_rte_better,
|
||||
};
|
||||
|
||||
struct protocol proto_l3vpn = {
|
||||
.name = "L3VPN",
|
||||
.template = "l3vpn%d",
|
||||
|
Loading…
Reference in New Issue
Block a user