• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

system/bt


Commit MetaInfo

Revision1e77fefc8b9c832239e1b32c6a6880376065e24e (tree)
Zeit2017-08-09 03:44:51
AutorPavlin Radoslavov <pavlin@goog...>
Commiterandroid-build-team Robot

Log Message

Disable PAN Reverse Tethering when connection originated by the Remote

* Check for valid interactions between the three PAN profile roles per

Table 1 in PAN Profile v1.0 spec.

* Explicitly disable connections to the local PANU if the remote is

not PANU.

Bug: 63145701
Test: External script
Change-Id: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
Merged-In: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
(cherry picked from commit 9aea2c2f92dd5245f6b35d564ce8e471fec2b4ec)

Ändern Zusammenfassung

Diff

--- a/stack/pan/pan_main.cc
+++ b/stack/pan/pan_main.cc
@@ -214,6 +214,39 @@ void pan_conn_ind_cb(uint16_t handle, BD_ADDR p_bda, tBT_UUID* remote_uuid,
214214 return;
215215 }
216216
217+ /* Check for valid interactions between the three PAN profile roles */
218+ /*
219+ * For reference, see Table 1 in PAN Profile v1.0 spec.
220+ * Note: the remote is the initiator.
221+ */
222+ bool is_valid_interaction = false;
223+ switch (remote_uuid->uu.uuid16) {
224+ case UUID_SERVCLASS_NAP:
225+ case UUID_SERVCLASS_GN:
226+ if (local_uuid->uu.uuid16 == UUID_SERVCLASS_PANU)
227+ is_valid_interaction = true;
228+ break;
229+ case UUID_SERVCLASS_PANU:
230+ is_valid_interaction = true;
231+ break;
232+ }
233+ /*
234+ * Explicitly disable connections to the local PANU if the remote is
235+ * not PANU.
236+ */
237+ if ((local_uuid->uu.uuid16 == UUID_SERVCLASS_PANU) &&
238+ (remote_uuid->uu.uuid16 != UUID_SERVCLASS_PANU)) {
239+ is_valid_interaction = false;
240+ }
241+ if (!is_valid_interaction) {
242+ PAN_TRACE_ERROR(
243+ "PAN Connection failed because of invalid PAN profile roles "
244+ "interaction: Remote UUID 0x%x Local UUID 0x%x",
245+ remote_uuid->uu.uuid16, local_uuid->uu.uuid16);
246+ BNEP_ConnectResp(handle, BNEP_CONN_FAILED_SRC_UUID);
247+ return;
248+ }
249+
217250 /* Requested destination role is */
218251 if (local_uuid->uu.uuid16 == UUID_SERVCLASS_PANU)
219252 req_role = PAN_ROLE_CLIENT;