Skip to contentSkip to conversation

IrLAP disconnection pending race

PATCH New Jean Tourrilhes 1 participant 1 message Feb 10, 2004 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IrLAP disconnection pending race

ir260_irlap_discon_pend_race.diff :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
o [FEATURE] Don't drop IrLAP connection is we *just* received an incomming IrLMP connection request.

include/net/irda/irlap.h renamed from include/net/irda/irlap.d4.h +6 -0
diff -u -p linux/include/net/irda/irlap.d4.h linux/include/net/irda/irlap.h
@@ -283,4 +283,10 @@ static inline int irlap_is_primary(struc
 	return(ret);
 }
 
+/* Clear a pending IrLAP disconnect. - Jean II */
+static inline void irlap_clear_disconnect(struct irlap_cb *self)
+{
+	self->disconnect_pending = FALSE;
+}
+
 #endif
net/irda/irlmp_event.c renamed from net/irda/irlmp_event.d4.c +8 -0
diff -u -p linux/net/irda/irlmp_event.d4.c linux/net/irda/irlmp_event.c
@@ -391,6 +391,14 @@ static void irlmp_state_active(struct la
 		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
 		 *  notify all LSAPs using this LAP, but that should be safe to