X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fcfm.c;h=fc999ab20f7554a6454f9dc15a7304052c1a63cc;hb=4653c5583a3ec9d7184782fee3d2f93602795686;hp=134d8b78bdb767be17f86d8d07ca017aebf84366;hpb=1ee62357e91d08a0bf901830805037680c88eece;p=sliver-openvswitch.git diff --git a/lib/cfm.c b/lib/cfm.c index 134d8b78b..fc999ab20 100644 --- a/lib/cfm.c +++ b/lib/cfm.c @@ -684,12 +684,17 @@ cfm_get_health(const struct cfm *cfm) /* Gets the operational state of 'cfm'. 'cfm' is considered operationally down * if it has received a CCM with the operationally down bit set from any of its - * remote maintenance points. Returns true if 'cfm' is operationally up. False - * otherwise. */ -bool + * remote maintenance points. Returns 1 if 'cfm' is operationally up, 0 if + * 'cfm' is operationally down, or -1 if 'cfm' has no operational state + * (because it isn't in extended mode). */ +int cfm_get_opup(const struct cfm *cfm) { - return cfm->remote_opup; + if (cfm->extended) { + return cfm->remote_opup; + } else { + return -1; + } } /* Populates 'rmps' with an array of remote maintenance points reachable by