summaryrefslogtreecommitdiff
path: root/lib/bfd.c
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2014-05-06 23:46:39 -0700
committerAlex Wang <alexw@nicira.com>2014-05-07 11:03:33 -0700
commit5383f2c2fe32315615e04bf411d2fd1953d59f31 (patch)
tree097022ae5b36cb9a3d06940e3ba85f15c67fbb96 /lib/bfd.c
parent7fcd0037f14d4641b0939c287d5dcb5bab31c8d7 (diff)
downloadopenvswitch-5383f2c2fe32315615e04bf411d2fd1953d59f31.tar.gz
bfd: Update bfd status on bfd creation and deletion.
Commit 88bf179aa3 (bfd/cfm: Check status change before update status to database.) used a boolean flag to trigger bfd status update. However, the flag is not set on bfd creation and deletion. To prevent any stale status in database, this commit makes bfd module always set the flag on bfd creation and deletion. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index 2d53bd27d..d83d198a1 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -388,6 +388,8 @@ bfd_configure(struct bfd *bfd, const char *name, const struct smap *cfg,
bfd_set_state(bfd, STATE_DOWN, DIAG_NONE);
memcpy(bfd->eth_dst, eth_addr_bfd, ETH_ADDR_LEN);
+
+ bfd_status_changed(bfd);
}
atomic_store(&bfd->check_tnl_key,
@@ -492,6 +494,7 @@ bfd_unref(struct bfd *bfd) OVS_EXCLUDED(mutex)
{
if (bfd && ovs_refcount_unref(&bfd->ref_cnt) == 1) {
ovs_mutex_lock(&mutex);
+ bfd_status_changed(bfd);
hmap_remove(all_bfds, &bfd->node);
netdev_close(bfd->netdev);
free(bfd->name);