network: Do not disconnect decice on network connect
PATCH 1/1 network: Do not disconnect decice on network connect
Initially, commit 3b6dd9aa9030 ("Add support for disconnecting networks first") introduce the __connman_device_disconnect() in __connman_network_connect(). It was there to allow autoconnect to work. The initial code was checking if only one device should be connected:
mode = connman_device_get_mode(network->device);
if (mode == CONNMAN_DEVICE_MODE_NETWORK_SINGLE)
__connman_device_disconnect(network->device);The service state machine has evolved over the time and this check is now part of the main service state machine. Though the code snippet in __connman_network_connect() was updated (the mode bits got removed) the disconnect was not removed.
For 1:1 mapping between device and network this is no issues. But in the case of oFono we can have several APN/networks per device. Due to this disconnect call it's not possible to have several networks per device. Let's remove it.
Reported by Athimoolam Rajkumar.
--- src/network.c | 2 -- 1 file changed, 2 deletions(-)
src/network.c +0 -2
@@ -1797,8 +1797,6 @@ int __connman_network_connect(struct connman_network *network)if (!network->device)return -ENODEV ; -__connman_device_disconnect (network->device); - network->connecting = true; err = network->driver->connect (network);
Signature · 1 line
2.32.0
Quoted 15 lines · Daniel Wagner
Initially, commit
3b6dd9aa9030("Add support for disconnecting networks first") introduce the__connman_device_disconnect()in__connman_network_connect(). It was there to allow autoconnect to work. The initial code was checking if only one device should be connected:mode = connman_device_get_mode(network->device); if (mode == CONNMAN_DEVICE_MODE_NETWORK_SINGLE) __connman_device_disconnect(network->device);The service state machine has evolved over the time and this check is now part of the main service state machine. Though the code snippet in
__connman_network_connect()was updated (the mode bits got removed) the disconnect was not removed.
Quoted 4 lines
For 1:1 mapping between device and network this is no issues. But in the case of oFono we can have several APN/networks per device. Due to this disconnect call it's not possible to have several networks per device. Let's remove it.
I've updated the commit message slightly and applied the patch.