summaryrefslogtreecommitdiff
path: root/lib/bfd.c
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2015-10-22 10:29:56 -0700
committerAndy Zhou <azhou@nicira.com>2015-10-22 19:53:45 -0700
commit2979b9158bff4d6fcbddf7e09131a8cfeb9ec746 (patch)
treed90d692d341111dad443e33740b642df4d85b95f /lib/bfd.c
parent67794d5617bff0b116b61f2bc8edde24624ebca7 (diff)
downloadopenvswitch-2979b9158bff4d6fcbddf7e09131a8cfeb9ec746.tar.gz
bfd: always export remote_state and remote_diagnostic to OVSDB
RFC 5880 specified bfd.RemoteSessionState as one of the state variables. In OVS implementation, this value is exported to OVSDB's BFD status column of the interface table, as one of the map elements, with the key of 'remote_state'. It can be surprising when the 'remote_state' map element disappears when BFD is in the 'DOWN' state, but otherwise always exported. Change to always exporting it, to make it more predictable for applications that monitors the BFD status column. While at it, make the same change to 'remote_diagnostic', so that it is also always exported to OVSDB for consistency. VMWare-BZ: 1535979 Reported-by: Mihir Gangar <gangarm@vmware.com> Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index dae682ff2..adac66646 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2014 Nicira, Inc.
+/* Copyright (c) 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -321,11 +321,8 @@ bfd_get_status(const struct bfd *bfd, struct smap *smap)
smap_add(smap, "state", bfd_state_str(bfd->state));
smap_add(smap, "diagnostic", bfd_diag_str(bfd->diag));
smap_add_format(smap, "flap_count", "%"PRIu64, bfd->flap_count);
-
- if (bfd->state != STATE_DOWN) {
- smap_add(smap, "remote_state", bfd_state_str(bfd->rmt_state));
- smap_add(smap, "remote_diagnostic", bfd_diag_str(bfd->rmt_diag));
- }
+ smap_add(smap, "remote_state", bfd_state_str(bfd->rmt_state));
+ smap_add(smap, "remote_diagnostic", bfd_diag_str(bfd->rmt_diag));
ovs_mutex_unlock(&mutex);
}