• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

system/bt


Commit MetaInfo

Revision0700e5b5a66014f364e9838b3a32839b1497ff3a (tree)
Zeit2017-09-15 02:54:03
AutorPavlin Radoslavov <pavlin@goog...>
CommiterDan Pasanen

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)
(cherry picked from commit 3f2ee5b546b65b5b021779588316249276ed3827)
(cherry picked from commit 40c7cefb12ac1a70bf7b1c770c1ab21a5b3f229e)
(cherry picked from commit f7a7f7a948e38195e8ca897785ac5d489082f0cc)
(cherry picked from commit b40497b27a0dce81d11f0dca09af6d81abf4bd92)

Ändern Zusammenfassung

Diff

--- a/stack/pan/pan_main.c
+++ b/stack/pan/pan_main.c
@@ -222,6 +222,39 @@ void pan_conn_ind_cb (UINT16 handle,
222222 return;
223223 }
224224
225+ /* Check for valid interactions between the three PAN profile roles */
226+ /*
227+ * For reference, see Table 1 in PAN Profile v1.0 spec.
228+ * Note: the remote is the initiator.
229+ */
230+ BOOLEAN is_valid_interaction = FALSE;
231+ switch (remote_uuid->uu.uuid16) {
232+ case UUID_SERVCLASS_NAP:
233+ case UUID_SERVCLASS_GN:
234+ if (local_uuid->uu.uuid16 == UUID_SERVCLASS_PANU)
235+ is_valid_interaction = TRUE;
236+ break;
237+ case UUID_SERVCLASS_PANU:
238+ is_valid_interaction = TRUE;
239+ break;
240+ }
241+ /*
242+ * Explicitly disable connections to the local PANU if the remote is
243+ * not PANU.
244+ */
245+ if ((local_uuid->uu.uuid16 == UUID_SERVCLASS_PANU) &&
246+ (remote_uuid->uu.uuid16 != UUID_SERVCLASS_PANU)) {
247+ is_valid_interaction = FALSE;
248+ }
249+ if (!is_valid_interaction) {
250+ PAN_TRACE_ERROR(
251+ "PAN Connection failed because of invalid PAN profile roles "
252+ "interaction: Remote UUID 0x%x Local UUID 0x%x",
253+ remote_uuid->uu.uuid16, local_uuid->uu.uuid16);
254+ BNEP_ConnectResp(handle, BNEP_CONN_FAILED_SRC_UUID);
255+ return;
256+ }
257+
225258 /* Requested destination role is */
226259 if (local_uuid->uu.uuid16 == UUID_SERVCLASS_PANU)
227260 req_role = PAN_ROLE_CLIENT;