patch-2.3.17 linux/net/irda/irlmp_event.c

Next file: linux/net/khttpd/misc.c
Previous file: linux/net/ipx/af_spx.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.16/linux/net/irda/irlmp_event.c linux/net/irda/irlmp_event.c
@@ -347,16 +347,17 @@
 		 *  must be the one that tries to close IrLAP. It will be 
 		 *  removed later and moved to the list of unconnected LSAPs
 		 */
-		if (hashbin_get_size(self->lsaps) == 1)
+		if (hashbin_get_size(self->lsaps) > 0)
 			irlmp_start_idle_timer(self, LM_IDLE_TIMEOUT);
-
+		else {
+			/* No more connections, so close IrLAP */
+			irlmp_next_lap_state(self, LAP_STANDBY);
+			irlap_disconnect_request(self->irlap);
+		}
 		break;
 	case LM_LAP_IDLE_TIMEOUT:
 		if (hashbin_get_size(self->lsaps) == 0) {
-			DEBUG(2, __FUNCTION__ 
-			      "(), no more LSAPs so time to close IrLAP\n");
 			irlmp_next_lap_state(self, LAP_STANDBY);
-			
 			irlap_disconnect_request(self->irlap);
 		} else
 			/* Still not ready, so wait a little bit more */

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