connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] network: Do not disconnect decice on network connect
@ 2021-08-29 19:32 Daniel Wagner
  2021-08-29 19:37 ` Daniel Wagner
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Wagner @ 2021-08-29 19:32 UTC (permalink / raw)
  To: connman; +Cc: Athimoolam Rajkumar, 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.

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(-)

diff --git a/src/network.c b/src/network.c
index b12bbc091b0c..1cbdf9cfed95 100644
--- a/src/network.c
+++ b/src/network.c
@@ -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);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-29 19:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-29 19:32 [PATCH] network: Do not disconnect decice on network connect Daniel Wagner
2021-08-29 19:37 ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).