patch-2.4.22 linux-2.4.22/net/irda/ircomm/ircomm_tty_attach.c

Next file: linux-2.4.22/net/irda/irda_device.c
Previous file: linux-2.4.22/net/irda/ircomm/ircomm_tty.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/net/irda/ircomm/ircomm_tty_attach.c linux-2.4.22/net/irda/ircomm/ircomm_tty_attach.c
@@ -515,6 +515,23 @@
 	
 	del_timer(&self->watchdog_timer);
 
+	/* Remove LM-IAS object now so it is not reused.
+	 * IrCOMM deals very poorly with multiple incomming connections.
+	 * It should looks a lot more like IrNET, and "dup" a server TSAP
+	 * to the application TSAP (based on various rules).
+	 * This is a cheap workaround allowing multiple clients to
+	 * connect to us. It will not always work.
+	 * Each IrCOMM socket has an IAS entry. Incomming connection will
+	 * pick the first one found. So, when we are fully connected,
+	 * we remove our IAS entries so that the next IAS entry is used.
+	 * We do that for *both* client and server, because a server
+	 * can also create client instances.
+	 * Jean II */
+	if (self->obj) {
+		irias_delete_object(self->obj);
+		self->obj = NULL;
+	}
+
 	/* 
 	 * IrCOMM link is now up, and if we are not using hardware
 	 * flow-control, then declare the hardware as running. Otherwise we
@@ -522,10 +539,10 @@
 	 * line.  
 	 */
 	if ((self->flags & ASYNC_CTS_FLOW) && ((self->settings.dce & IRCOMM_CTS) == 0)) {
-		IRDA_DEBUG(0, __FUNCTION__ "(), waiting for CTS ...\n");
+		IRDA_DEBUG(0, "%s(), waiting for CTS ...\n", __FUNCTION__);
 		return;
 	} else {
-		IRDA_DEBUG(2, __FUNCTION__ "(), starting hardware!\n");
+		IRDA_DEBUG(1, "%s(), starting hardware!\n", __FUNCTION__);
 
 		self->tty->hw_stopped = 0;
 	

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)