bridge: Minor style fix.
[sliver-openvswitch.git] / vswitchd / bridge.c
index b28ef26..7d1c8ed 100644 (file)
@@ -1721,8 +1721,7 @@ iface_refresh_status(struct iface *iface)
                                     netdev_features_is_full_duplex(current)
                                     ? "full" : "half");
         ovsrec_interface_set_link_speed(iface->cfg, &bps, 1);
-    }
-    else {
+    } else {
         ovsrec_interface_set_duplex(iface->cfg, NULL);
         ovsrec_interface_set_link_speed(iface->cfg, NULL, 0);
     }
@@ -1769,12 +1768,21 @@ iface_refresh_cfm_stats(struct iface *iface)
         }
         ovsrec_interface_set_cfm_fault_status(cfg, (char **) reasons, j);
 
-        ovsrec_interface_set_cfm_remote_opstate(cfg, (status.remote_opstate
-                                                      ? "up" : "down"));
+        if (status.remote_opstate >= 0) {
+            const char *remote_opstate = status.remote_opstate ? "up" : "down";
+            ovsrec_interface_set_cfm_remote_opstate(cfg, remote_opstate);
+        } else {
+            ovsrec_interface_set_cfm_remote_opstate(cfg, NULL);
+        }
+
         ovsrec_interface_set_cfm_remote_mpids(cfg,
                                               (const int64_t *)status.rmps,
                                               status.n_rmps);
-        ovsrec_interface_set_cfm_health(cfg, &cfm_health, 1);
+        if (cfm_health >= 0) {
+            ovsrec_interface_set_cfm_health(cfg, &cfm_health, 1);
+        } else {
+            ovsrec_interface_set_cfm_health(cfg, NULL, 0);
+        }
     }
 }