KRT: Fixes route reload
Did not really worked
This commit is contained in:
parent
c5ff44a703
commit
7069fc9e72
2 changed files with 7 additions and 1 deletions
|
@ -451,7 +451,7 @@ again:
|
||||||
*pbest = best->next;
|
*pbest = best->next;
|
||||||
best->next = n->routes;
|
best->next = n->routes;
|
||||||
n->routes = best;
|
n->routes = best;
|
||||||
if (best != old_best || !(n->n.flags & KRF_INSTALLED))
|
if (best != old_best || !(n->n.flags & KRF_INSTALLED) || p->reload)
|
||||||
{
|
{
|
||||||
DBG("%I/%d: announcing (metric=%d)\n", n->n.prefix, n->n.pxlen, best->u.krt.metric);
|
DBG("%I/%d: announcing (metric=%d)\n", n->n.prefix, n->n.pxlen, best->u.krt.metric);
|
||||||
krt_learn_announce_update(p, best);
|
krt_learn_announce_update(p, best);
|
||||||
|
@ -461,6 +461,8 @@ again:
|
||||||
DBG("%I/%d: uptodate (metric=%d)\n", n->n.prefix, n->n.pxlen, best->u.krt.metric);
|
DBG("%I/%d: uptodate (metric=%d)\n", n->n.prefix, n->n.pxlen, best->u.krt.metric);
|
||||||
}
|
}
|
||||||
FIB_ITERATE_END(f);
|
FIB_ITERATE_END(f);
|
||||||
|
|
||||||
|
p->reload = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1031,7 +1033,10 @@ krt_reload_routes(struct proto *P)
|
||||||
/* Although we keep learned routes in krt_table, we rather schedule a scan */
|
/* Although we keep learned routes in krt_table, we rather schedule a scan */
|
||||||
|
|
||||||
if (KRT_CF->learn)
|
if (KRT_CF->learn)
|
||||||
|
{
|
||||||
|
p->reload = 1;
|
||||||
krt_scan_timer_kick(p);
|
krt_scan_timer_kick(p);
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ struct krt_proto {
|
||||||
node krt_node; /* Node in krt_proto_list */
|
node krt_node; /* Node in krt_proto_list */
|
||||||
byte ready; /* Initial feed has been finished */
|
byte ready; /* Initial feed has been finished */
|
||||||
byte initialized; /* First scan has been finished */
|
byte initialized; /* First scan has been finished */
|
||||||
|
byte reload; /* Next scan is doing reload */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern pool *krt_pool;
|
extern pool *krt_pool;
|
||||||
|
|
Loading…
Reference in a new issue