Acked-by: Ethan Jackson <et...@nicira.com>
On Wed, Mar 6, 2013 at 2:53 PM, Ben Pfaff <b...@nicira.com> wrote: > Commit 9a9e3786b3a8 (ofproto: Merge all the CFM query functions into one.) > mistakenly transformed a tristate variable into a Boolean one. This commit > fixes the problem. > > Signed-off-by: Ben Pfaff <b...@nicira.com> > --- > ofproto/ofproto.h | 7 ++++++- > vswitchd/bridge.c | 9 +++++++-- > 2 files changed, 13 insertions(+), 3 deletions(-) > > diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h > index a3c52b5..3ea56df 100644 > --- a/ofproto/ofproto.h > +++ b/ofproto/ofproto.h > @@ -363,9 +363,14 @@ void ofproto_free_ofproto_controller_info(struct > shash *); > /* CFM status query. */ > struct ofproto_cfm_status { > enum cfm_fault_reason faults; /* 0 if not faulted. */ > - bool remote_opstate; /* True if remote CFM endpoint is up. > */ > int health; /* Health status in [0,100] range. */ > > + /* 0 if the remote CFM endpoint is operationally down, > + * 1 if the remote CFM endpoint is operationally up, > + * -1 if we don't know because the remote CFM endpoint is not in > extended > + * mode. */ > + int remote_opstate; > + > /* MPIDs of remote maintenance points whose CCMs have been received. > */ > const uint64_t *rmps; > size_t n_rmps; > diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c > index b28ef26..311753d 100644 > --- a/vswitchd/bridge.c > +++ b/vswitchd/bridge.c > @@ -1769,8 +1769,13 @@ 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); > -- > 1.7.2.5 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev >
_______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev