[PATCH v2] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

It's possible from wpa_s to change the state from completed to scanning
without going through disconnected state if interface signals that the carrier
went off and on (IFF_LOWER_UP flag).

This will cause dead lock similar in c810464828d6764bea304de3e9b6b151aa05e313
if the wifi gets into associating state as the network-connected is still true
but wifi-connected is not.
---
 plugins/wifi.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index d0d7917..046373c 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2341,6 +2341,9 @@ static void interface_state(GSupplicantInterface 
*interface)
 
switch (state) {
case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected)
+   connman_network_set_connected(network, false);
+
break;
 
case G_SUPPLICANT_STATE_AUTHENTICATING:
@@ -2435,6 +2438,14 @@ static void interface_state(GSupplicantInterface 
*interface)
else
wifi-connected = false;
break;
+   case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected) {
+   wifi-connected = false;
+   start_autoscan(device);
+   } else {
+   wifi-connected = false;
+   }
+   break;
case G_SUPPLICANT_STATE_COMPLETED:
wifi-connected = true;
break;
-- 
2.1.4

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Re: [PATCH] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread Pasi Sjöholm
Hi Tomasz,

Will still need to modify the patch a bit because start_autoscan()
checks for wifi-connected and will not start if it's true. Therefore
moving start_autoscan() after the wifi-connected has been set to false
in the end of the interface_state()-function.

Br,
Pasi

On 06.05.2015 11:51, Tomasz Bursztyka wrote:
 Hi Pasi,
 
 Nice catch!
 
 ACK from me.
 
 Tomasz
 
 From: Pasi Sjöholm pasi.sjoh...@jollamobile.com
 
 It's possible from wpa_s to change the state from completed to
 scanning without going through disconnected state if interface
 signals that the carrier went off and on (IFF_LOWER_UP flag).
 
 This will cause dead lock similar in 
 c810464828d6764bea304de3e9b6b151aa05e313 if the wifi gets into
 associating state as the network-connected is still true but
 wifi-connected is not. --- plugins/wifi.c | 5 + 1 file
 changed, 5 insertions(+)
 
 diff --git a/plugins/wifi.c b/plugins/wifi.c index
 d0d7917..47df08e 100755 --- a/plugins/wifi.c +++
 b/plugins/wifi.c @@ -2341,6 +2341,11 @@ static void 
 interface_state(GSupplicantInterface *interface) switch (state)
 { case G_SUPPLICANT_STATE_SCANNING: +if (wifi-connected)
 { +connman_network_set_connected(network, false); +
 start_autoscan(device); +} + break; case
 G_SUPPLICANT_STATE_AUTHENTICATING:
 
 ___ connman mailing
 list connman@connman.net 
 https://lists.connman.net/mailman/listinfo/connman
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Re: [PATCH] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread Tomasz Bursztyka
Did not check thoroughly, I though setting network connected to false 
would do.


Ok then.


Hi Tomasz,

Will still need to modify the patch a bit because start_autoscan()
checks for wifi-connected and will not start if it's true. Therefore
moving start_autoscan() after the wifi-connected has been set to false
in the end of the interface_state()-function.

Br,
Pasi

On 06.05.2015 11:51, Tomasz Bursztyka wrote:

Hi Pasi,

Nice catch!

ACK from me.

Tomasz


From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

It's possible from wpa_s to change the state from completed to
scanning without going through disconnected state if interface
signals that the carrier went off and on (IFF_LOWER_UP flag).

This will cause dead lock similar in
c810464828d6764bea304de3e9b6b151aa05e313 if the wifi gets into
associating state as the network-connected is still true but
wifi-connected is not. --- plugins/wifi.c | 5 + 1 file
changed, 5 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c index
d0d7917..47df08e 100755 --- a/plugins/wifi.c +++
b/plugins/wifi.c @@ -2341,6 +2341,11 @@ static void
interface_state(GSupplicantInterface *interface) switch (state)
{ case G_SUPPLICANT_STATE_SCANNING: +if (wifi-connected)
{ +connman_network_set_connected(network, false); +
start_autoscan(device); +} + break; case
G_SUPPLICANT_STATE_AUTHENTICATING:

___ connman mailing
list connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

[PATCH] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

It's possible from wpa_s to change the state from completed to scanning
without going through disconnected state if interface signals that the carrier
went off and on (IFF_LOWER_UP flag).

This will cause dead lock similar in c810464828d6764bea304de3e9b6b151aa05e313
if the wifi gets into associating state as the network-connected is still true
but wifi-connected is not.
---
 plugins/wifi.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index d0d7917..47df08e 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2341,6 +2341,11 @@ static void interface_state(GSupplicantInterface 
*interface)
 
switch (state) {
case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected) {
+   connman_network_set_connected(network, false);
+   start_autoscan(device);
+   }
+
break;
 
case G_SUPPLICANT_STATE_AUTHENTICATING:
-- 
2.1.4

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Re: [PATCH] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread Tomasz Bursztyka

Hi Pasi,

Nice catch!

ACK from me.

Tomasz


From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

It's possible from wpa_s to change the state from completed to scanning
without going through disconnected state if interface signals that the carrier
went off and on (IFF_LOWER_UP flag).

This will cause dead lock similar in c810464828d6764bea304de3e9b6b151aa05e313
if the wifi gets into associating state as the network-connected is still true
but wifi-connected is not.
---
  plugins/wifi.c | 5 +
  1 file changed, 5 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index d0d7917..47df08e 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2341,6 +2341,11 @@ static void interface_state(GSupplicantInterface 
*interface)
  
  	switch (state) {

case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected) {
+   connman_network_set_connected(network, false);
+   start_autoscan(device);
+   }
+
break;
  
  	case G_SUPPLICANT_STATE_AUTHENTICATING:


___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Re: [PATCH v2] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread Pasi Sjöholm
Hi Tomasz,

On 06.05.2015 13:46, Tomasz Bursztyka wrote:
 +case G_SUPPLICANT_STATE_SCANNING: +if
 (wifi-connected) { +wifi-connected = false; +
 start_autoscan(device); +} else { +
 wifi-connected = false; +}
 You could remove the else { } (but keep the inner statement)

Done.

 With a unique wifi device, once connected, it is still possible to
 do a scan (and it stays connected of course). Can you check if your
 patch does not break this?

Yes, scanning still works (nothing gets disconnected) and wpa_s does
not change the interface state from completed to anything else while
doing extra scans while being connected.

Br,
Pasi
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH v3] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread Pasi Sjöholm
Hi Jukka,

 +case G_SUPPLICANT_STATE_SCANNING: + if (wifi-connected) { +
 wifi-connected = false; +   start_autoscan(device); +   
 } else +
 wifi-connected = false; +   break;
 
 or you could just say
 
 + if (wifi-connected) +  start_autoscan(device); 
 + +
 wifi-connected = false; +break;

Not really, because that was the original problem why I did the
version 2 of the patch. This is due wifi-connected needs to be false
before start_autoscan() can actually happen as there is if
(wifi-connected) return; check on the start_autoscan().

Br,
Pasi
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH v3] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread Tomasz Bursztyka

Ok ACK from me then.

Tomasz


From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

It's possible from wpa_s to change the state from completed to scanning
without going through disconnected state if interface signals that the carrier
went off and on (IFF_LOWER_UP flag).

This will cause dead lock similar in c810464828d6764bea304de3e9b6b151aa05e313
if the wifi gets into associating state as the network-connected is still true
but wifi-connected is not.
---
  plugins/wifi.c | 10 ++
  1 file changed, 10 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index d0d7917..a22faae 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2341,6 +2341,9 @@ static void interface_state(GSupplicantInterface 
*interface)
  
  	switch (state) {

case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected)
+   connman_network_set_connected(network, false);
+
break;
  
  	case G_SUPPLICANT_STATE_AUTHENTICATING:

@@ -2435,6 +2438,13 @@ static void interface_state(GSupplicantInterface 
*interface)
else
wifi-connected = false;
break;
+   case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected) {
+   wifi-connected = false;
+   start_autoscan(device);
+   } else
+   wifi-connected = false;
+   break;
case G_SUPPLICANT_STATE_COMPLETED:
wifi-connected = true;
break;


___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Multiple connections?

2015-05-06 Thread Daniel Nyström
Hi ConnMan folks!

I've just started using ConnMan and figured my situation is a bit
different than most of you.

I've got a GSM module (SIM800h) run by oFono connected to ConnMan. I
also got a LAN connection with DHCP.

I need both of these connections to be available, but of course only
one can be the primary interface (hence the one with a default
gateway). We can say the cellular connection always has this role if
available.

How can I make this using ConnMan? How can I make the DHCP ignore the
default gw? Or is there a better way to solve this?

Thanks in advance!

Best regards
Daniel
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH v2] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread Tomasz Bursztyka

Hi Pasi,


+   case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected) {
+   wifi-connected = false;
+   start_autoscan(device);
+   } else {
+   wifi-connected = false;
+   }


You could remove the else { } (but keep the inner statement)

With a unique wifi device, once connected, it is still possible to do a 
scan (and it stays connected of course).

Can you check if your patch does not break this?

Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v3] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

It's possible from wpa_s to change the state from completed to scanning
without going through disconnected state if interface signals that the carrier
went off and on (IFF_LOWER_UP flag).

This will cause dead lock similar in c810464828d6764bea304de3e9b6b151aa05e313
if the wifi gets into associating state as the network-connected is still true
but wifi-connected is not.
---
 plugins/wifi.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index d0d7917..a22faae 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2341,6 +2341,9 @@ static void interface_state(GSupplicantInterface 
*interface)
 
switch (state) {
case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected)
+   connman_network_set_connected(network, false);
+
break;
 
case G_SUPPLICANT_STATE_AUTHENTICATING:
@@ -2435,6 +2438,13 @@ static void interface_state(GSupplicantInterface 
*interface)
else
wifi-connected = false;
break;
+   case G_SUPPLICANT_STATE_SCANNING:
+   if (wifi-connected) {
+   wifi-connected = false;
+   start_autoscan(device);
+   } else
+   wifi-connected = false;
+   break;
case G_SUPPLICANT_STATE_COMPLETED:
wifi-connected = true;
break;
-- 
2.1.4

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Re: [PATCH v3] wifi: disconnect if wpa_s state changes from completed to scanning

2015-05-06 Thread Jukka Rissanen
Hi Pasi,

On ke, 2015-05-06 at 14:22 +0300, pasi.sjoh...@jolla.com wrote:
 From: Pasi Sjöholm pasi.sjoh...@jollamobile.com
 
 It's possible from wpa_s to change the state from completed to scanning
 without going through disconnected state if interface signals that the carrier
 went off and on (IFF_LOWER_UP flag).
 
 This will cause dead lock similar in c810464828d6764bea304de3e9b6b151aa05e313
 if the wifi gets into associating state as the network-connected is still 
 true
 but wifi-connected is not.
 ---
  plugins/wifi.c | 10 ++
  1 file changed, 10 insertions(+)
 
 diff --git a/plugins/wifi.c b/plugins/wifi.c
 index d0d7917..a22faae 100755
 --- a/plugins/wifi.c
 +++ b/plugins/wifi.c
 @@ -2341,6 +2341,9 @@ static void interface_state(GSupplicantInterface 
 *interface)
  
   switch (state) {
   case G_SUPPLICANT_STATE_SCANNING:
 + if (wifi-connected)
 + connman_network_set_connected(network, false);
 +
   break;
  
   case G_SUPPLICANT_STATE_AUTHENTICATING:
 @@ -2435,6 +2438,13 @@ static void interface_state(GSupplicantInterface 
 *interface)
   else
   wifi-connected = false;
   break;
 + case G_SUPPLICANT_STATE_SCANNING:
 + if (wifi-connected) {
 + wifi-connected = false;
 + start_autoscan(device);
 + } else
 + wifi-connected = false;
 + break;

or you could just say

+   if (wifi-connected)
+   start_autoscan(device);
+   
+   wifi-connected = false;
+   break;
 

Cheers,
Jukka


___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

re-connecting to enterprise network

2015-05-06 Thread Thomas Green
All,

On 4/28, I posted a problem that I'm having with reconnecting to an enterprise 
network.  The initial connection using the agent to prompt for the 
username/passphrase  works fine, but the next connection fails with an 
Input/output error.  The connection after that will again prompt from 
username/password, and connects.  I've been delving into this, but have not as 
yet come up with a solution.  I'm on connman 1.28.  Is this something that can 
be looked at?

Tom
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman