summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-10-26core: Do not call the callback on btd_cancel_authorizationHEADmasterLuiz Augusto von Dentz1-1/+4
btd_cancel_authorization should work like g_source_remove and not attempt to reach the callback as its maybe already invalid or lead to double free situations such as this: Invalid write of size 4 at 0x13D480: connection_lost (avdtp.c:1102) by 0x13F37A: session_cb (avdtp.c:2281) by 0x4C7B824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C7BB57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C7BF51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x122B21: main (main.c:551) Address 0x6512ac0 is 32 bytes inside a block of size 1,184 free'd at 0x4A07786: free (vg_replace_malloc.c:446) by 0x4C8150E: g_free (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x13D4A9: connection_lost (avdtp.c:1216) by 0x13D55E: auth_cb (avdtp.c:2471) by 0x17E99A: service_auth_cancel (adapter.c:1021) by 0x183C67: btd_cancel_authorization (adapter.c:3358) by 0x13D477: connection_lost (avdtp.c:1098) by 0x13F37A: session_cb (avdtp.c:2281) by 0x4C7B824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C7BB57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C7BF51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x122B21: main (main.c:551)
2012-10-26core: Fix memory leakLuiz Augusto von Dentz1-0/+2
1,262 (64 direct, 1,198 indirect) bytes in 1 blocks are definitely lost in loss record 280 of 290 at 0x4A0881C: malloc (vg_replace_malloc.c:270) by 0x4C813FE: g_malloc (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C95801: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C95D55: g_slice_alloc0 (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C746AA: g_key_file_new (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x18136C: load_config (adapter.c:2620) by 0x18353B: adapter_init (adapter.c:2708) by 0x17E62E: btd_manager_register_adapter (manager.c:337) by 0x191171: mgmt_event.part.36 (mgmt.c:1081) by 0x4C7B824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C7BB57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C7BF51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4)
2012-10-25systemd: prevent duplicate logging messages in journalMarti Raudsepp1-0/+1
By default, both stdout and syslog messages go to the systemd journal, which results in duplicate messages being logged.
2012-10-25event: Remove write of LastSeen infoFrédéric Danis1-13/+0
2012-10-25adapter: Move storage names to cache directoryFrédéric Danis2-6/+99
2012-10-25adapter: Move saved config to ini-file formatFrédéric Danis1-38/+168
Read and write config file in ini-file format. If the file can not be loaded, try to convert legacy configuration.
2012-10-25adapter: Read mode in storage at initFrédéric Danis4-50/+44
Mgmt interface allows to change connectable and discoverable adapter status even if the adapter is off. So both status are changed during adapter init. Remove on_mode from btd_adapter_get_mode(), as it is no more used. Update src/mgmt.c and plugins/neard.c
2012-10-25adapter: Read discoverable timeout in storage at initFrédéric Danis1-12/+7
2012-10-25adapter: Read pairable timeout in storage at initFrédéric Danis1-11/+10
2012-10-25adapter: Move pairable read to load_config()Frédéric Danis1-4/+4
2012-10-25adapter: Remove device class storageFrédéric Danis3-15/+7
2012-10-25adapter: Read name in storage at initFrédéric Danis1-0/+13
2012-10-22mgmt: Add support for LE peripheral modeJohan Hedberg1-4/+4
2012-10-22core: Remove unnecessary include from glib-helper.cJohan Hedberg1-1/+0
2012-10-19attrib: Fix memory leak if att_data_list_alloc failsLudek Finstrle1-3/+9
Fix for memory leak which was introduced in commit f8619bef3406a2134082dc41c208105fe028c09f.
2012-10-19core: Update gdbus function callsLucas De Marchi2-94/+69
Done by the following semantic patch, with manual tweaks afterwards due to changes in 80-chars line breaks: // <smpl> @r1 @ expression E1; @@ g_dbus_pending_property_success( - E1, ...) @r2 @ expression E1; @@ g_dbus_pending_property_error( - E1, ...) @r3 @ expression E1; @@ g_dbus_pending_property_error_valist( - E1, ...) // </smpl>
2012-10-18adapter: Fix memory leak on discovery cleanupAnderson Lizardo1-2/+2
During discovery cleanup, it was attempted to send a DevicesFound() D-Bus signal for pending found devices, but adapter->discovery was set to NULL before calling send_devices_found(), therefore it never sent any signal (and there was a leak of discovery->pending list). Fixes this memory leak when pairing two LE devices: ==1822== 8 bytes in 1 blocks are definitely lost in loss record 42 of 246 ==1822== at 0x482BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==1822== by 0x48869AA: standard_malloc (gmem.c:85) ==1822== by 0x4886E42: g_malloc (gmem.c:159) ==1822== by 0x489B26D: g_slice_alloc (gslice.c:1003) ==1822== by 0x489C10A: g_slist_prepend (gslist.c:265) ==1822== by 0x1855AE: adapter_update_found_devices (adapter.c:2846) ==1822== by 0x191431: btd_event_device_found (event.c:260) ==1822== by 0xBC01001A: ??? ==1822==
2012-10-17device: Fix modifying list while iteratingMikel Astiz1-2/+2
A list should not be modified while iterating on it, and in this case the solution is trivial: the code is just trying to free the whole list with a previous call to profile->device_remove() per list item.
2012-10-16adapter: Remove not used definesSzymon Janc1-4/+0
check_address and OFF_TIMER are not used anymore.
2012-10-16mgmt: Remove not used members from controller_infoSzymon Janc1-10/+2
notified, version, manufacturer and dev_class were not used for anything usefull. For debug print reply can be used directly.
2012-10-16mgmt: Make mgmt_update_powered return voidSzymon Janc1-4/+2
mgmt_update_powered always returned 0 and this was never checked by caller.
2012-10-16device: Mark services as resolved also when loading from storageJohan Hedberg1-0/+5
2012-10-15adapter: Use g_slist_free_full for cleaning up discovery->foundJohan Hedberg1-3/+2
2012-10-15adapter: Use idle callbacks for forcing DevicesFound eventsJohan Hedberg1-3/+2
This way we ensure that we include all found devices from the current mainloop iteration into the DevicesFound signal.
2012-10-15device: Implement Device.CancelPairing methodJohan Hedberg1-0/+17
2012-10-15adapter: Remove legacy CancelDeviceCreation methodJohan Hedberg1-36/+0
2012-10-15core: Add timer for removing temporary discovered device objectsJohan Hedberg2-2/+47
2012-10-12adapter: Add DevicesFound signalJohan Hedberg1-38/+155
2012-10-12adapter: Remove out of range devices trackingJohan Hedberg1-44/+1
With interleaved discovery the inquiry is so short that there's a good chance of nearby devices in not showing up during some cycles. This makes tracking "out of range" devices unreliable and it's therefore better to remove it. Devices get their RSSI property invalidated when a discovery cycle finishes so devices that are not found anymore can still be easily sorted with a lower priority by UIs.
2012-10-12core: Create devices dynamically during discoveryJohan Hedberg5-439/+173
2012-10-12adapter: Remove Create(Paired)Device methodsJohan Hedberg1-130/+0
These are not needed when devices get created dynamically during discovery.
2012-10-12device: Add device_name_known convenience functionJohan Hedberg2-0/+6
2012-10-12device: Add LegacyPairing and RSSI propertiesJohan Hedberg2-0/+69
These are needed for the new device discovery where we create objects for each found device.
2012-10-11core: Fix connecting to an already connected device on pairingJoão Paulo Rechi Vita1-1/+1
2012-10-11gattrib: Add support for listening for events for specific handlesVinicius Costa Gomes1-1/+1
We want only the profile that implements a service to be notified of changes on that service. Before this patch, all the registered event notifiers are being called.
2012-10-11attrib: Fix not checking if att_data_list_alloc failsVinicius Costa Gomes1-0/+9
Now that this function may fail in more usual situations (invalid input), we have to check its return value.
2012-10-11attrib: Remove all the usages of ATT_MAX_MTUVinicius Costa Gomes1-1/+2
This "define" was bogus for two reasons: 1. There's no concept of maximum MTU in the ATT level; 2. It was used as a maximum attribute value length.
2012-10-10event: Use bool instead gboolean for legacy parameterSzymon Janc5-8/+8
This will avoid mixing bool and gboolean in btd_event_device_found definition. Whole execution chain for legacy parameter is also converted to bool type.
2012-10-10core: Pass confirm name as bool valueSzymon Janc5-5/+6
confirm_name is a boolean value and can be pass as such instead of uint8_t.
2012-10-09core: fix stop scanning after GCEPJoão Paulo Rechi Vita1-11/+15
The session type identification on struct session req (commit 328661a0) broke the stop condition of the LE Genereal Connection Establishment Procedure. This commit creates new identificators for discovery sessions and makes their naming a bit more clear.
2012-10-09core: Add initial Device.Pair() implementationJohan Hedberg1-0/+47
This will ultimately replace Adapter.CreatePairedDevice()
2012-10-09device: Remove not used device_set_class functionSzymon Janc2-13/+0
With mgmt interface CoD cannot change as it is only received in EIR when device is discovered or connected. Was only used in btd_event_remote_class which is now removed.
2012-10-09adapter: Remove not used btd_adapter_switch_{online,offline} functionsSzymon Janc2-45/+0
Were used only in Maemo plugin which is now removed.
2012-10-09storage: Remove not used read_remote_featuresSzymon Janc2-47/+0
It was only usefull with hciops.
2012-10-09storage: Remove not used write_features_infoSzymon Janc2-34/+0
This was used in hciops.
2012-10-09storage: Remove not used write_version_infoSzymon Janc2-20/+0
This was used in hciops only.
2012-10-09storage: Remove not used read_remote_eirSzymon Janc2-43/+0
This function is not used. Previously it was used to determine if remote device is legacy or not.
2012-10-09event: Don't store EIR in btd_event_device_foundSzymon Janc3-26/+0
It is never read and was usefull only to gather EIR data for testing which can also be done with hcidump etc.
2012-10-09Simplify checking if found device is legacySzymon Janc5-72/+23
This simplify code by removing pairing_is_legacy() function which was always returning FALSE due to EIR being always present with mgmt interface (this also fix small issue when first DeviceFound signal emitted for legacy device was having LegacyPairing set to false). Instead of using btd_event_set_legacy_pairing to set legacy pairing in remote_dev_info handle it in similar way to rssi.
2012-10-09adapter: Emit signals through DBus.PropertiesLucas De Marchi1-95/+47