Re: [PATCH v2] device: Make sure the device is up and running before enabling it

2014-08-08 Thread Patrik Flykt
On Thu, 2014-08-07 at 12:05 +0300, Tomasz Bursztyka wrote:
 It can happen that, after a unproper ConnMan exit, a device is still up.
 Once ConnMan is restarted cleanup_devices() will put this device down.
 But then, it will never set it up again.

Applied, thanks!

Patrik

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


Re: [PATCH] gsupplicant: Do P2P detection after interface property load

2014-08-08 Thread Patrik Flykt
On Wed, 2014-08-06 at 23:51 -0400, Eduardo Abinader wrote:
 When interface was already created in wpa_supplicant,
 p2p detection was failing. Thus, calling p2p detection
 after interface property has been signaled fixes this
 detection failure.

Applied, thanks!

Patrik

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


[PATCH 2/2] service: Reset service to idle state when retrying after a failure

2014-08-08 Thread Patrik Flykt
A failed service that is reconnected has to be set to idle state before
connecting it again. Changing state from failed to idle also has to be
allowed. Unless this is done, a service already in failed state won't
be able to detect that a subsequent reconnect also must re-trigger
a new reconnect attempt in __connman_service_ipconfig_indicate_state()
and service_indicate_state().

Fixes CM-622
---
 src/service.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/service.c b/src/service.c
index 0108fab..6a42d48 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5683,9 +5683,6 @@ int __connman_service_ipconfig_indicate_state(struct 
connman_service *service,
switch (new_state) {
case CONNMAN_SERVICE_STATE_UNKNOWN:
case CONNMAN_SERVICE_STATE_IDLE:
-   if (service-state == CONNMAN_SERVICE_STATE_FAILURE)
-   return -EINVAL;
-   break;
case CONNMAN_SERVICE_STATE_ASSOCIATION:
break;
case CONNMAN_SERVICE_STATE_CONFIGURATION:
@@ -5954,6 +5951,8 @@ int __connman_service_connect(struct connman_service 
*service,
if (!is_ipconfig_usable(service))
return -ENOLINK;
 
+   __connman_service_clear_error(service);
+
err = service_connect(service);
 
service-connect_reason = reason;
-- 
1.9.1

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


[PATCH 1/2] service: Expand switch case with all values

2014-08-08 Thread Patrik Flykt
Instead of using a default value, list all values and call the functions
outside of the switch block.
---
 src/service.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/service.c b/src/service.c
index 294ceca..0108fab 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5941,13 +5941,21 @@ int __connman_service_connect(struct connman_service 
*service,
case CONNMAN_SERVICE_TYPE_GPS:
case CONNMAN_SERVICE_TYPE_P2P:
return -EINVAL;
-   default:
-   if (!is_ipconfig_usable(service))
-   return -ENOLINK;
 
-   err = service_connect(service);
+   case CONNMAN_SERVICE_TYPE_ETHERNET:
+   case CONNMAN_SERVICE_TYPE_GADGET:
+   case CONNMAN_SERVICE_TYPE_BLUETOOTH:
+   case CONNMAN_SERVICE_TYPE_CELLULAR:
+   case CONNMAN_SERVICE_TYPE_VPN:
+   case CONNMAN_SERVICE_TYPE_WIFI:
+   break;
}
 
+   if (!is_ipconfig_usable(service))
+   return -ENOLINK;
+
+   err = service_connect(service);
+
service-connect_reason = reason;
if (err = 0) {
set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
-- 
1.9.1

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


Re: [PATCH 0/2] Fix retrying of a service when given wrong passphrase

2014-08-08 Thread Jonathan Liu

On 8/08/2014 9:50 PM, Patrik Flykt wrote:

Hi,

Here is a fix for CM-622, prepended by a simple code cleanup patch.

Please test,

Patrik



Patrik Flykt (2):
   service: Expand switch case with all values
   service: Reset service to idle state when retrying after a failure

  src/service.c | 21 ++---
  1 file changed, 14 insertions(+), 7 deletions(-)


I have tested the patchset. It fixes CM-622 for me.

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


Re: [PATCH 2/2] service: Reset service to idle state when retrying after a failure

2014-08-08 Thread Patrik Flykt
On Fri, 2014-08-08 at 14:02 +0200, Richard Röjfors wrote:
  case CONNMAN_SERVICE_STATE_UNKNOWN:
  case CONNMAN_SERVICE_STATE_IDLE:
  -   if (service-state == CONNMAN_SERVICE_STATE_FAILURE)
  -   return -EINVAL;
  -   break;
  case CONNMAN_SERVICE_STATE_ASSOCIATION:
  break;
 
 This will also cause CONNMAN_SERVICE_STATE_UNKNOWN to fall through,
 was that intended?

Even though nothing sets the state to CONNMAN_SERVICE_STATE_UNKNOWN via
this function, we should not let that fall through. I'll fix on Monday.


Thanks,

Patrik

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

problems with default timeservers

2014-08-08 Thread Peter A. Bigot
I'm having problems setting up connman 1.24 to do NTP-related stuff on a 
beaglebone under Yocto's 1.7 development system.


I've configured FallbackTimeservers in a [General] section per 
connman.conf(5), and put it in /etc/connman/main.conf, 
/var/lib/connman/main.conf, and as a section of 
/var/lib/connman/settings.  It has no visible effect.


I've used set-global-timeservers, which put a Timeservers line in the 
[global] section of /var/lib/connman/settings.  It has no effect.  I've 
tried existing connections, new connections, and rebooting.


The only thing that works is:

  connmanctl config ethernet_MAC_cable --timeservers server1 server2

which puts the same Timeservers line that's in settings into 
ethernet_MAC_cable/settings.  The next time the connection comes up the 
time is set correctly.


As best I can tell, TimeUpdates is left in its default form which 
appears to be auto based on a dump of the clock properties.


Is this the behavior I should expect from FallbackTimeservers and global 
Timeservers?  If not, any idea what's going wrong?


Thanks.

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