From 3291e6583f5bdb4fc6037cd33a357890127c3a1d Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Tue, 6 Apr 2010 23:39:57 +0200 Subject: Do not set network index from PAN disconnect reply There is no need to track the network's connected state through its index. As a matter of fact, setting the network index to -1 on the PAN disconnect path can triggers segmentation faults when powering the device off at the same time. --- plugins/bluetooth.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'plugins/bluetooth.c') diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 9a43059d..cec5e641 100644 --- a/plugins/bluetooth.c +++ b/plugins/bluetooth.c @@ -131,9 +131,6 @@ static int pan_connect(struct connman_network *network) if (path == NULL) return -EINVAL; - if (connman_network_get_index(network) >= 0) - return -EISCONN; - message = dbus_message_new_method_call(BLUEZ_SERVICE, path, BLUEZ_NETWORK_INTERFACE, CONNECT); if (message == NULL) @@ -186,7 +183,6 @@ static void disconnect_reply(DBusPendingCall *call, void *user_data) } connman_network_set_connected(network, FALSE); - connman_network_set_index(network, -1); done: dbus_message_unref(reply); @@ -205,9 +201,6 @@ static int pan_disconnect(struct connman_network *network) if (path == NULL) return -EINVAL; - if (connman_network_get_index(network) < 0) - return -ENOTCONN; - message = dbus_message_new_method_call(BLUEZ_SERVICE, path, BLUEZ_NETWORK_INTERFACE, DISCONNECT); if (message == NULL) -- cgit v1.2.3