summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2014-01-08 18:51:43 -0800
committerEthan Jackson <ethan@nicira.com>2014-01-08 18:57:04 -0800
commit615309cfb6992867251d01f1c34955568b3950ea (patch)
treef88b3bfc5a54967071d682159762f6f224e69252
parent6c3eee823e95d13c613935f0252c8a523bc6ef20 (diff)
downloadopenvswitch-615309cfb6992867251d01f1c34955568b3950ea.tar.gz
bfd: Fix cpath_down set failure.
Commit ccc09689 (bfd: Implement Bidirectional Forwarding Detection.) set the bfd local diagnostic to "Concatenated Path Down" in response to the set of cpath_down only when the current local diagnostic is "None". However, since the bfd local diagnostic is not reset when the bfd state is restored from last erroneous state, the set of cpath_down will not update the local diagnostic in that case. This commit fixes the bug by always checking for local diagnostic change when cpath_down is set or reset. Bug #22625 Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
-rw-r--r--lib/bfd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index e5bf5a140..347444fd2 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -403,9 +403,7 @@ bfd_configure(struct bfd *bfd, const char *name, const struct smap *cfg,
cpath_down = smap_get_bool(cfg, "cpath_down", false);
if (bfd->cpath_down != cpath_down) {
bfd->cpath_down = cpath_down;
- if (bfd->diag == DIAG_NONE || bfd->diag == DIAG_CPATH_DOWN) {
- bfd_set_state(bfd, bfd->state, DIAG_NONE);
- }
+ bfd_set_state(bfd, bfd->state, DIAG_NONE);
need_poll = true;
}
@@ -1015,7 +1013,7 @@ static void
bfd_set_state(struct bfd *bfd, enum state state, enum diag diag)
OVS_REQUIRES(mutex)
{
- if (diag == DIAG_NONE && bfd->cpath_down) {
+ if (bfd->cpath_down) {
diag = DIAG_CPATH_DOWN;
}