]> git.proxmox.com Git - mirror_ovs.git/commitdiff
rconn: Only increment seqno when connection actually drops or reconnects.
authorBen Pfaff <blp@nicira.com>
Thu, 30 Apr 2015 06:48:58 +0000 (23:48 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 6 May 2015 00:21:05 +0000 (17:21 -0700)
rconn_get_connection_seqno() is documented to change only when an rconn
connects or disconnnects, but in fact it was also changing whenever an
rconn went into or out of the "idle" state (following sending an echo
request).  This fixes the problem.

rconn_get_connection_seqno() didn't have any existing users, but an
upcoming commit adds one.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
lib/rconn.c

index 6692b4603ddcc58486b8ea733920d59619a9cf6e..a4a5dbfeef24a7acfaa7a22717bbc6c9e815c366 100644 (file)
@@ -1267,7 +1267,7 @@ static void
 state_transition(struct rconn *rc, enum state state)
     OVS_REQUIRES(rc->mutex)
 {
-    rc->seqno += (rc->state == S_ACTIVE) != (state == S_ACTIVE);
+    rc->seqno += is_connected_state(rc->state) != is_connected_state(state);
     if (is_connected_state(state) && !is_connected_state(rc->state)) {
         rc->probably_admitted = false;
     }