diff mbox series

[ovs-dev,v10.1,4/6] ovn-northd: Simplify logic in build_bfd_table().

Message ID 20210218195112.1391467-5-blp@ovn.org
State Accepted
Headers show
Series Add DDlog implementation of ovn-northd | expand

Commit Message

Ben Pfaff Feb. 18, 2021, 7:51 p.m. UTC
The code here checked whether 'bfd_e' was null even though that wasn't
necessary given the control flow just above it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 northd/ovn-northd.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 39d798782002..8c74c9fd66b9 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -7457,15 +7457,15 @@  build_bfd_table(struct northd_context *ctx, struct hmap *bfd_connections,
             int d_mult = nb_bt->n_detect_mult ? nb_bt->detect_mult[0]
                                               : BFD_DEF_DETECT_MULT;
             sbrec_bfd_set_detect_mult(sb_bt, d_mult);
-        } else if (strcmp(bfd_e->sb_bt->status, nb_bt->status)) {
-            if (!strcmp(nb_bt->status, "admin_down") ||
-                !strcmp(bfd_e->sb_bt->status, "admin_down")) {
-                sbrec_bfd_set_status(bfd_e->sb_bt, nb_bt->status);
-            } else {
-                nbrec_bfd_set_status(nb_bt, bfd_e->sb_bt->status);
+        } else {
+            if (strcmp(bfd_e->sb_bt->status, nb_bt->status)) {
+                if (!strcmp(nb_bt->status, "admin_down") ||
+                    !strcmp(bfd_e->sb_bt->status, "admin_down")) {
+                    sbrec_bfd_set_status(bfd_e->sb_bt, nb_bt->status);
+                } else {
+                    nbrec_bfd_set_status(nb_bt, bfd_e->sb_bt->status);
+                }
             }
-        }
-        if (bfd_e) {
             build_bfd_update_sb_conf(nb_bt, bfd_e->sb_bt);
 
             hmap_remove(&sb_only, &bfd_e->hmap_node);