secchan: Make sure fail-open doesn't drop the first messages from connection.
authorBen Pfaff <blp@nicira.com>
Wed, 15 Oct 2008 22:46:48 +0000 (15:46 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 15 Oct 2008 22:46:48 +0000 (15:46 -0700)
Fail-open mode is entered or left in a secchan "periodic" callback, which
may not be called immediately after the connection to the controller
actually comes up.  This can cause the fail-open local-packet CB to
locally handle messages from the datapath and drop them, causing the
controller to think that it's being ignore and drop the connection.

Thanks to Dan for raising the issue.

secchan/secchan.c

index 5b58787b815a2d3845bf8e0c77023d978992dfbf..5037cec27f406940ec85ec6315f030b0c0472a9a 100644 (file)
@@ -1878,7 +1878,7 @@ static bool
 fail_open_local_packet_cb(struct relay *r, void *fail_open_)
 {
     struct fail_open_data *fail_open = fail_open_;
-    if (!fail_open->lswitch) {
+    if (rconn_is_connected(fail_open->remote_rconn) || !fail_open->lswitch) {
         return false;
     } else {
         lswitch_process_packet(fail_open->lswitch, fail_open->local_rconn,