Skip to content

Commit 551fa8c

Browse files
committed
zebra: Fix dplane_fpm_nl to allow for fast configuration
If you have this order in your configuration file: no fpm use-next-hop-groups fpm address 127.0.0.1 the dplane code was using the same event thread t_event and the second add event in the code was going, you already have an event scheduled and as such the second event does not overwrite it. Leaving no code to actually start the whole processing. There are probably other cli iterations that will cause this fun as well, but I'm not going to spend the time sussing them out at the moment. Fixes: #12314 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
1 parent dc31de9 commit 551fa8c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

zebra/dplane_fpm_nl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ struct fpm_nl_ctx {
9898
struct thread *t_read;
9999
struct thread *t_write;
100100
struct thread *t_event;
101+
struct thread *t_nhg;
101102
struct thread *t_dequeue;
102103

103104
/* zebra events. */
@@ -271,7 +272,7 @@ DEFUN(fpm_use_nhg, fpm_use_nhg_cmd,
271272
return CMD_SUCCESS;
272273

273274
thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
274-
FNE_TOGGLE_NHG, &gfnc->t_event);
275+
FNE_TOGGLE_NHG, &gfnc->t_nhg);
275276

276277
return CMD_SUCCESS;
277278
}
@@ -287,7 +288,7 @@ DEFUN(no_fpm_use_nhg, no_fpm_use_nhg_cmd,
287288
return CMD_SUCCESS;
288289

289290
thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
290-
FNE_TOGGLE_NHG, &gfnc->t_event);
291+
FNE_TOGGLE_NHG, &gfnc->t_nhg);
291292

292293
return CMD_SUCCESS;
293294
}
@@ -1367,6 +1368,8 @@ static int fpm_nl_finish_early(struct fpm_nl_ctx *fnc)
13671368
THREAD_OFF(fnc->t_ribwalk);
13681369
THREAD_OFF(fnc->t_rmacreset);
13691370
THREAD_OFF(fnc->t_rmacwalk);
1371+
THREAD_OFF(fnc->t_event);
1372+
THREAD_OFF(fnc->t_nhg);
13701373
thread_cancel_async(fnc->fthread->master, &fnc->t_read, NULL);
13711374
thread_cancel_async(fnc->fthread->master, &fnc->t_write, NULL);
13721375
thread_cancel_async(fnc->fthread->master, &fnc->t_connect, NULL);

0 commit comments

Comments
 (0)