Hi Vasyl,
On 02/23/2018 09:27 PM, Vasyl Vavrychuk wrote:
On every connect I get 'Skipping disconnect of ..., network is
connecting'.
This is happening because __connman_network_connect sets connecting
flag before __connman_device_disconnect. The last function then prints
warning due to this connecting flag.
Changed order of assigning connecting and __connman_device_disconnect
fixes this. Connman logic is not effected due to the way how flags
connected and associating are handled in __connman_network_connect
and __connman_network_disconnect.
---
src/network.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/network.c b/src/network.c
index 8c5979f7..4757d0d7 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1468,10 +1468,10 @@ int __connman_network_connect(struct connman_network *network)
if (!network->device)
return -ENODEV;
- network->connecting = true;
-
__connman_device_disconnect(network->device);
+ network->connecting = true;
+
err = network->driver->connect(network);
if (err < 0) {
if (err == -EINPROGRESS)
I found this part of always confusing but never took time to really try
to figure out why it is there. After some digging in the history I think
we can safely remove the __connman_device_disconnect() call instead of
moving the network->connecting part. With setting network->connecting =
true we have a no-op in __connman_device_disconnect(). So why bother to
call it anyway from here?
Thanks,
Daniel