Skip to content

Commit

Permalink
[Bluetooth] Disconnect L2CAP connection after last RFCOMM DLC
Browse files Browse the repository at this point in the history
The RFCOMM specification says that the device closing the last DLC on
a particular session is responsible for closing the multiplexer by
closing the corresponding L2CAP channel.

Signed-off-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
holtmann committed May 4, 2007
1 parent 77f2a45 commit 9cf5b0e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions net/bluetooth/rfcomm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,12 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
case BT_DISCONN:
d->state = BT_CLOSED;
__rfcomm_dlc_close(d, 0);

if (list_empty(&s->dlcs)) {
s->state = BT_DISCONN;
rfcomm_send_disc(s, 0);
}

break;
}
} else {
Expand All @@ -1067,6 +1073,10 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
s->state = BT_CONNECTED;
rfcomm_process_connect(s);
break;

case BT_DISCONN:
rfcomm_session_put(s);
break;
}
}
return 0;
Expand Down

0 comments on commit 9cf5b0e

Please sign in to comment.