]> git.hungrycats.org Git - linux/commitdiff
[IRDA]: IrLAP disconnection pending race.
authorJean Tourrilhes <jt@bougret.jpl.hp.com>
Mon, 9 Feb 2004 10:39:49 +0000 (02:39 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 9 Feb 2004 10:39:49 +0000 (02:39 -0800)
o [FEATURE] Don't drop IrLAP connection is we *just* received an
incomming IrLMP connection request.

include/net/irda/irlap.h
net/irda/irlmp_event.c

index 9385cffa836c563860eba6002c0e48a3f8b7acf9..c7c2aecaf637c488f99898141f2323aa86c37b94 100644 (file)
@@ -283,4 +283,10 @@ static inline int irlap_is_primary(struct irlap_cb *self)
        return(ret);
 }
 
+/* Clear a pending IrLAP disconnect. - Jean II */
+static inline void irlap_clear_disconnect(struct irlap_cb *self)
+{
+       self->disconnect_pending = FALSE;
+}
+
 #endif
index 7ef8fd5ddf04c21a3d670b90cfbea5ea8629f805..d6e551226e5b7a05717831fab0a73e74b41ea093 100644 (file)
@@ -390,6 +390,14 @@ static void irlmp_state_active(struct lap_cb *self, IRLMP_EVENT event,
        case LM_LAP_CONNECT_REQUEST:
                IRDA_DEBUG(4, "%s(), LS_CONNECT_REQUEST\n", __FUNCTION__);
 
+               /*
+                * IrLAP may have a pending disconnect. We tried to close
+                * IrLAP, but it was postponed because the link was
+                * busy or we were still sending packets. As we now
+                * need it, make sure it stays on. Jean II
+                */
+               irlap_clear_disconnect(self->irlap);
+
                /*
                 *  LAP connection already active, just bounce back! Since we
                 *  don't know which LSAP that tried to do this, we have to