bfd: Notify connectivity_seq on rmt_state changes.
authorJoe Stringer <joestringer@nicira.com>
Wed, 25 Dec 2013 00:50:53 +0000 (16:50 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 26 Dec 2013 18:16:42 +0000 (10:16 -0800)
The bfd module did not previously change the global connectivity_seq
when the remote state changed, which means that such state changes may
not be propagated to the database. This is particularly bad if this is
the last state transition to happen in an otherwise stable environment.
This patch checks for transitions in remote state, and ensures that the
main thread will update the database when these happen.

Bug #22136.

Co-authored-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/bfd.c

index a4179f8..b8574d5 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -735,6 +735,10 @@ bfd_process_packet(struct bfd *bfd, const struct flow *flow,
         goto out;
     }
 
+    if (bfd->rmt_state != rmt_state) {
+        seq_change(connectivity_seq_get());
+    }
+
     bfd->rmt_disc = ntohl(msg->my_disc);
     bfd->rmt_state = rmt_state;
     bfd->rmt_flags = flags;