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);
}
}
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);
+ }
}
}