On Mon, Sep 30, 2019 at 11:15:45PM +0800, Winston Chen wrote: > Hi, > > I am using BFD neighbor to config BFD sessions statically. I found that if I > add/remove BFD neighbors in bird.conf and ask bird to reload with HUP > signal, bird cannot reload the configuration correctly. > ... > After digging into the code, I found that it looks like there is a bug in > function bfd_reconfigure_neighbors. It loops to check neighbor in old and > new configuration. There is a return in the block if (bfd_same_neighbor(nn, > on)). If there is neighbor existing in both new and old, reconfiguration > might be skipped.
Hi Thanks. You are right, the return should just continue in the outer loop. Your patch seems OK, i just used a simpler fix (attached). -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c index f774e67b..a3e6d01c 100644 --- a/proto/bfd/bfd.c +++ b/proto/bfd/bfd.c @@ -837,10 +837,11 @@ bfd_reconfigure_neighbors(struct bfd_proto *p, struct bfd_config *new) nn->req = on->req; nn->active = 1; - return; + goto next; } bfd_stop_neighbor(p, on); + next:; } WALK_LIST(nn, new->neigh_list)