X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=blobdiff_plain;f=vswitchd%2Fbridge.c;h=e35f34d6b1171a37b9ae081c56056f761e49852b;hp=45a14911f5c89bc9b1a7f0814331ef3ca77b77f8;hb=88bf179aa3f3fa89822edcd9b882e0f06d39bf08;hpb=3834bcf2bf9106114bca70264b7a0bdb7351ff80 diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 45a14911f..e35f34d6b 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1876,9 +1876,13 @@ iface_refresh_cfm_stats(struct iface *iface) { const struct ovsrec_interface *cfg = iface->cfg; struct ofproto_cfm_status status; + int error; - if (!ofproto_port_get_cfm_status(iface->port->bridge->ofproto, - iface->ofp_port, &status)) { + error = ofproto_port_get_cfm_status(iface->port->bridge->ofproto, + iface->ofp_port, &status); + if (error < 0) { + /* Do nothing if there is no status change since last update. */ + } else if (error > 0) { ovsrec_interface_set_cfm_fault(cfg, NULL, 0); ovsrec_interface_set_cfm_fault_status(cfg, NULL, 0); ovsrec_interface_set_cfm_remote_opstate(cfg, NULL); @@ -2286,9 +2290,11 @@ instant_stats_run(void) iface_refresh_cfm_stats(iface); smap_init(&smap); - ofproto_port_get_bfd_status(br->ofproto, iface->ofp_port, - &smap); - ovsrec_interface_set_bfd_status(iface->cfg, &smap); + error = ofproto_port_get_bfd_status(br->ofproto, iface->ofp_port, + &smap); + if (error >= 0) { + ovsrec_interface_set_bfd_status(iface->cfg, &smap); + } smap_destroy(&smap); } }