Diff between 6bc584b11b8b10dbd717ca4012a6c09afb18d1c7 and 3c20aa6c2ff1980f82c9546117be898515088a37

Changed Files

File Additions Deletions Status
tools/iso-tester.c +7 -3 modified

Full Patch

diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index 725fd33..5655088 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -1683,13 +1683,17 @@ static void setup_powered_callback(uint8_t status, uint16_t length,
 	for (i = 0; i < data->client_num; i++) {
 		struct hciemu_client *client;
 		struct bthost *host;
+		uint8_t sid = 0;
 
 		client = hciemu_get_client(data->hciemu, i);
 		host = hciemu_client_host(client);
 		bthost_set_cmd_complete_cb(host, client_connectable_complete,
 									data);
-		bthost_set_ext_adv_params(host, isodata->sid != 0xff ?
-						isodata->sid : 0x00);
+
+		if (isodata)
+			sid = isodata->sid;
+
+		bthost_set_ext_adv_params(host, sid != 0xff ? sid : 0x00);
 		bthost_set_ext_adv_enable(host, 0x01);
 
 		if (!isodata)
@@ -1903,7 +1907,7 @@ static int create_iso_sock(struct test_data *data)
 		addr->iso_family = AF_BLUETOOTH;
 		bacpy(&addr->iso_bdaddr, (void *) master_bdaddr);
 		addr->iso_bdaddr_type = BDADDR_LE_PUBLIC;
-		err = bind(sk, (struct sockaddr *) addr, sizeof(addr));
+		err = bind(sk, (struct sockaddr *) addr, sizeof(*addr));
 	}
 
 	if (err < 0) {