[maemo-commits] [maemo-commits] r15401 - in projects/connectivity/bluez-utils-debian/trunk: . patches

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Apr 15 16:47:10 EEST 2008
Author: jh
Date: 2008-04-15 16:47:10 +0300 (Tue, 15 Apr 2008)
New Revision: 15401

Added:
   projects/connectivity/bluez-utils-debian/trunk/patches/008_mem_full.patch
Modified:
   projects/connectivity/bluez-utils-debian/trunk/changelog
Log:
Prepare for 3.28-0osso3

Modified: projects/connectivity/bluez-utils-debian/trunk/changelog
===================================================================
--- projects/connectivity/bluez-utils-debian/trunk/changelog	2008-04-15 13:24:44 UTC (rev 15400)
+++ projects/connectivity/bluez-utils-debian/trunk/changelog	2008-04-15 13:47:10 UTC (rev 15401)
@@ -1,3 +1,9 @@
+bluez-utils (3.28-0osso3) unstable; urgency=low
+
+  * CreateBonding should fail if storing the link key fails. Fixes: NB#83023
+
+ -- Johan Hedberg <johan.hedberg at nokia.com>  Tue, 15 Apr 2008 13:37:39 +0000
+
 bluez-utils (3.28-0osso2) unstable; urgency=low
 
   * Fix parsing of SCORouting setting when HFP is disabled. Fixes: NB#81554

Added: projects/connectivity/bluez-utils-debian/trunk/patches/008_mem_full.patch
===================================================================
--- projects/connectivity/bluez-utils-debian/trunk/patches/008_mem_full.patch	2008-04-15 13:24:44 UTC (rev 15400)
+++ projects/connectivity/bluez-utils-debian/trunk/patches/008_mem_full.patch	2008-04-15 13:47:10 UTC (rev 15401)
@@ -0,0 +1,72 @@
+--- hcid/security.c.orig	2008-03-12 14:24:18.000000000 +0000
++++ hcid/security.c	2008-04-15 13:35:04.000000000 +0000
+@@ -187,6 +187,38 @@
+ 	hci_req_queue_process(dev_id);
+ }
+ 
++static int get_handle(int dev, bdaddr_t *sba, bdaddr_t *dba, uint16_t *handle)
++{
++	struct hci_conn_list_req *cl;
++	struct hci_conn_info *ci;
++	char addr[18];
++	int i;
++
++	cl = g_malloc0(10 * sizeof(*ci) + sizeof(*cl));
++
++	ba2str(sba, addr);
++	cl->dev_id = hci_devid(addr);
++	cl->conn_num = 10;
++	ci = cl->conn_info;
++
++	if (ioctl(dev, HCIGETCONNLIST, (void *) cl) < 0) {
++		g_free(cl);
++		return -EIO;
++	}
++
++	for (i = 0; i < cl->conn_num; i++, ci++) {
++		if (bacmp(&ci->bdaddr, dba) == 0) {
++			*handle = ci->handle;
++			g_free(cl);
++			return 0;
++		}
++	}
++
++	g_free(cl);
++
++	return -ENOENT;
++}
++
+ static inline int get_bdaddr(int dev, bdaddr_t *sba, uint16_t handle, bdaddr_t *dba)
+ {
+ 	struct hci_conn_list_req *cl;
+@@ -270,17 +302,27 @@
+ 	evt_link_key_notify *evt = ptr;
+ 	bdaddr_t *dba = &evt->bdaddr;
+ 	char sa[18], da[18];
+-	int dev_id;
++	int dev_id, err;
+ 
+ 	ba2str(sba, sa); ba2str(dba, da);
+ 	info("link_key_notify (sba=%s, dba=%s)", sa, da);
+ 
+ 	dev_id = hci_devid(sa);
+ 
+-	write_link_key(sba, dba, evt->link_key, evt->key_type,
++	err = write_link_key(sba, dba, evt->link_key, evt->key_type,
+ 						io_data[dev_id].pin_length);
++	if (err < 0) {
++		uint16_t handle;
++
++		error("write_link_key: %s (%d)", strerror(-err), -err);
+ 
+-	hcid_dbus_bonding_process_complete(sba, dba, 0);
++		hcid_dbus_bonding_process_complete(sba, dba, HCI_MEMORY_FULL);
++
++		if (get_handle(dev, sba, dba, &handle) == 0)
++			hci_disconnect(dev, htobs(handle),
++					HCI_OE_LOW_RESOURCES, 500);
++	} else
++		hcid_dbus_bonding_process_complete(sba, dba, 0);
+ 
+ 	io_data[dev_id].pin_length = -1;
+ }


More information about the maemo-commits mailing list