diff mbox series

[v1] obex: Fix the PBAP GET request in PTS testing

Message ID 20241111111625.1887695-1-quic_amisjain@quicinc.com (mailing list archive)
State Accepted
Commit b22bbf873f819ceef4d50feabcebe907f309c68a
Headers show
Series [v1] obex: Fix the PBAP GET request in PTS testing | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Amisha Jain Nov. 11, 2024, 11:16 a.m. UTC
This change is required for passing below PTS testcases:
1. PBAP/PSE/PBD/BV-02-C
2. PBAP/PSE/PBD/BV-03-C
3. PBAP/PSE/PBD/BI-01-C
4. PBAP/PSE/PBD/BV-13-C
5. PBAP/PSE/PBD/BV-14-C
6. PBAP/PSE/PBD/BV-17-C

PTS sends all the GET phonebook requests without extra params.
Therefore, the PBAP server is rejecting the requests with a
'Bad Request' response.
So append 'maxlistcount' as default param in GET request to
avoid testcase failure.

---
 obexd/plugins/pbap.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

Comments

bluez.test.bot@gmail.com Nov. 11, 2024, 1:02 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=908365

---Test result---

Test Summary:
CheckPatch                    PASS      0.47 seconds
GitLint                       PASS      0.33 seconds
BuildEll                      PASS      24.95 seconds
BluezMake                     PASS      1688.10 seconds
MakeCheck                     PASS      13.07 seconds
MakeDistcheck                 PASS      183.09 seconds
CheckValgrind                 PASS      255.34 seconds
CheckSmatch                   PASS      362.03 seconds
bluezmakeextell               PASS      123.68 seconds
IncrementalBuild              PASS      1435.02 seconds
ScanBuild                     PASS      1020.19 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org Nov. 11, 2024, 3:20 p.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 11 Nov 2024 16:46:25 +0530 you wrote:
> This change is required for passing below PTS testcases:
> 1. PBAP/PSE/PBD/BV-02-C
> 2. PBAP/PSE/PBD/BV-03-C
> 3. PBAP/PSE/PBD/BI-01-C
> 4. PBAP/PSE/PBD/BV-13-C
> 5. PBAP/PSE/PBD/BV-14-C
> 6. PBAP/PSE/PBD/BV-17-C
> 
> [...]

Here is the summary with links:
  - [v1] obex: Fix the PBAP GET request in PTS testing
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b22bbf873f81

You are awesome, thank you!
diff mbox series

Patch

diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c
index 4175f9de8..64641c798 100644
--- a/obexd/plugins/pbap.c
+++ b/obexd/plugins/pbap.c
@@ -438,10 +438,6 @@  static struct apparam_field *parse_aparam(const uint8_t *buffer, uint32_t hlen)
 	GObexApparam *apparam;
 	struct apparam_field *param;
 
-	apparam = g_obex_apparam_decode(buffer, hlen);
-	if (apparam == NULL)
-		return NULL;
-
 	param = g_new0(struct apparam_field, 1);
 
 	/*
@@ -449,25 +445,28 @@  static struct apparam_field *parse_aparam(const uint8_t *buffer, uint32_t hlen)
 	 * should be assume as Maximum value in vcardlisting 65535
 	 */
 	param->maxlistcount = UINT16_MAX;
-
-	g_obex_apparam_get_uint8(apparam, ORDER_TAG, &param->order);
-	g_obex_apparam_get_uint8(apparam, SEARCHATTRIB_TAG,
+	apparam = g_obex_apparam_decode(buffer, hlen);
+	if (apparam) {
+		g_obex_apparam_get_uint8(apparam, ORDER_TAG, &param->order);
+		g_obex_apparam_get_uint8(apparam, SEARCHATTRIB_TAG,
 						&param->searchattrib);
-	g_obex_apparam_get_uint8(apparam, FORMAT_TAG, &param->format);
-	g_obex_apparam_get_uint16(apparam, MAXLISTCOUNT_TAG,
+		g_obex_apparam_get_uint8(apparam, FORMAT_TAG, &param->format);
+		g_obex_apparam_get_uint16(apparam, MAXLISTCOUNT_TAG,
 						&param->maxlistcount);
-	g_obex_apparam_get_uint16(apparam, LISTSTARTOFFSET_TAG,
+		g_obex_apparam_get_uint16(apparam, LISTSTARTOFFSET_TAG,
 						&param->liststartoffset);
-	g_obex_apparam_get_uint64(apparam, FILTER_TAG, &param->filter);
-	param->searchval = g_obex_apparam_get_string(apparam, SEARCHVALUE_TAG);
+		g_obex_apparam_get_uint64(apparam, FILTER_TAG, &param->filter);
+		param->searchval = g_obex_apparam_get_string(apparam,
+						SEARCHVALUE_TAG);
+
+		g_obex_apparam_free(apparam);
+	}
 
 	DBG("o %x sa %x sv %s fil %" G_GINT64_MODIFIER "x for %x max %x off %x",
 			param->order, param->searchattrib, param->searchval,
 			param->filter, param->format, param->maxlistcount,
 			param->liststartoffset);
 
-	g_obex_apparam_free(apparam);
-
 	return param;
 }