mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-05 21:01:32 +00:00
Hopefully fix the 'bgp dump routes-mrt' command to actually dump routes.
Should recognise the absence of an interval now and schedule one-shot dump. hopefully.
This commit is contained in:
parent
29db05b4a5
commit
fba3d22b84
@ -130,8 +130,13 @@ bgp_dump_interval_add (struct bgp_dump *bgp_dump, int interval)
|
|||||||
{
|
{
|
||||||
int bgp_dump_interval_func (struct thread *);
|
int bgp_dump_interval_func (struct thread *);
|
||||||
|
|
||||||
|
if (interval > 0 )
|
||||||
bgp_dump->t_interval = thread_add_timer (master, bgp_dump_interval_func,
|
bgp_dump->t_interval = thread_add_timer (master, bgp_dump_interval_func,
|
||||||
bgp_dump, interval);
|
bgp_dump, interval);
|
||||||
|
else
|
||||||
|
bgp_dump->t_interval = thread_add_event (master, bgp_dump_interval_func,
|
||||||
|
bgp_dump, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +301,6 @@ int
|
|||||||
bgp_dump_interval_func (struct thread *t)
|
bgp_dump_interval_func (struct thread *t)
|
||||||
{
|
{
|
||||||
struct bgp_dump *bgp_dump;
|
struct bgp_dump *bgp_dump;
|
||||||
|
|
||||||
bgp_dump = THREAD_ARG (t);
|
bgp_dump = THREAD_ARG (t);
|
||||||
bgp_dump->t_interval = NULL;
|
bgp_dump->t_interval = NULL;
|
||||||
|
|
||||||
@ -310,8 +314,11 @@ bgp_dump_interval_func (struct thread *t)
|
|||||||
bgp_dump_routes_func (AFI_IP6);
|
bgp_dump_routes_func (AFI_IP6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if interval is set reschedule */
|
||||||
|
if (bgp_dump->interval > 0)
|
||||||
bgp_dump_interval_add (bgp_dump, bgp_dump->interval);
|
bgp_dump_interval_add (bgp_dump, bgp_dump->interval);
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,9 +482,10 @@ int
|
|||||||
bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump, int type,
|
bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump, int type,
|
||||||
char *path, char *interval_str)
|
char *path, char *interval_str)
|
||||||
{
|
{
|
||||||
|
unsigned int interval;
|
||||||
|
|
||||||
if (interval_str)
|
if (interval_str)
|
||||||
{
|
{
|
||||||
unsigned int interval;
|
|
||||||
|
|
||||||
/* Check interval string. */
|
/* Check interval string. */
|
||||||
interval = bgp_dump_parse_time (interval_str);
|
interval = bgp_dump_parse_time (interval_str);
|
||||||
@ -492,9 +500,14 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump, int type,
|
|||||||
free (bgp_dump->interval_str);
|
free (bgp_dump->interval_str);
|
||||||
bgp_dump->interval_str = strdup (interval_str);
|
bgp_dump->interval_str = strdup (interval_str);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
interval = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create interval thread. */
|
/* Create interval thread. */
|
||||||
bgp_dump_interval_add (bgp_dump, interval);
|
bgp_dump_interval_add (bgp_dump, interval);
|
||||||
}
|
|
||||||
|
|
||||||
/* Set type. */
|
/* Set type. */
|
||||||
bgp_dump->type = type;
|
bgp_dump->type = type;
|
||||||
|
Loading…
Reference in New Issue
Block a user