[ovs-dev] [PATCH] bfd: Fix cpath_down set failure.
Ethan Jackson
ethan at nicira.com
Thu Jan 9 02:57:41 UTC 2014
Sounds good, I'll merge this shortly.
Ethan
On Wed, Jan 8, 2014 at 6:52 PM, Alex Wang <alexw at nicira.com> wrote:
> Sorry, forgot to add the v2,
>
> One additional point, we cannot directly call "bfd_set_state(bfd,
> bfd->state, bfd->diag)" since that will not work when we reset the
> cpath_down.
>
> Thanks,
>
>
> On Wed, Jan 8, 2014 at 6:51 PM, Alex Wang <alexw at nicira.com> wrote:
>>
>> Commit ccc09689 (bfd: Implement Bidirectional Forwarding Detection.)
>> set the bfd local diagnostic to "Concatenated Path Down" in response
>> to the set of cpath_down only when the current local diagnostic is
>> "None". However, since the bfd local diagnostic is not reset when
>> the bfd state is restored from last erroneous state, the set of
>> cpath_down will not update the local diagnostic in that case.
>>
>> This commit fixes the bug by always checking for local diagnostic
>> change when cpath_down is set or reset.
>>
>> Bug #22625
>>
>> Signed-off-by: Alex Wang <alexw at nicira.com>
>> ---
>> lib/bfd.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/bfd.c b/lib/bfd.c
>> index b8574d5..1b35ee4 100644
>> --- a/lib/bfd.c
>> +++ b/lib/bfd.c
>> @@ -403,9 +403,7 @@ bfd_configure(struct bfd *bfd, const char *name, const
>> struct smap *cfg,
>> cpath_down = smap_get_bool(cfg, "cpath_down", false);
>> if (bfd->cpath_down != cpath_down) {
>> bfd->cpath_down = cpath_down;
>> - if (bfd->diag == DIAG_NONE || bfd->diag == DIAG_CPATH_DOWN) {
>> - bfd_set_state(bfd, bfd->state, DIAG_NONE);
>> - }
>> + bfd_set_state(bfd, bfd->state, DIAG_NONE);
>> need_poll = true;
>> }
>>
>> @@ -1022,7 +1020,7 @@ static void
>> bfd_set_state(struct bfd *bfd, enum state state, enum diag diag)
>> OVS_REQUIRES(mutex)
>> {
>> - if (diag == DIAG_NONE && bfd->cpath_down) {
>> + if (bfd->cpath_down) {
>> diag = DIAG_CPATH_DOWN;
>> }
>>
>> --
>> 1.7.9.5
>>
>
More information about the dev
mailing list