From 52bd2e7544be9ec275fe3ab5e2c8dc9f5c2af272 Mon Sep 17 00:00:00 2001 From: Jean Tourrilhes Date: Mon, 9 Feb 2004 02:39:49 -0800 Subject: [PATCH] [IRDA]: IrLAP disconnection pending race. o [FEATURE] Don't drop IrLAP connection is we *just* received an incomming IrLMP connection request. --- include/net/irda/irlap.h | 6 ++++++ net/irda/irlmp_event.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h index 9385cffa836c5..c7c2aecaf637c 100644 --- a/include/net/irda/irlap.h +++ b/include/net/irda/irlap.h @@ -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 diff --git a/net/irda/irlmp_event.c b/net/irda/irlmp_event.c index 7ef8fd5ddf04c..d6e551226e5b7 100644 --- a/net/irda/irlmp_event.c +++ b/net/irda/irlmp_event.c @@ -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 -- 2.53.0