Re: [PATCH] service: Check NULL pointer when setting ipconfig.

2011-08-26 Thread Samuel Ortiz
Hi Jukka,

On Fri, Aug 26, 2011 at 03:10:51PM +0300, Jukka Rissanen wrote:
> Fixes BMC#22766
Thanks, patch applied now.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH] network: Read only the ipconfig data if we have no address.

2011-08-26 Thread Samuel Ortiz
Hi Jukka,

On Fri, Aug 26, 2011 at 02:43:10PM +0300, Jukka Rissanen wrote:
> We must not read ipconfig data from file if there is already a valid
> address that was set by service set_property().
> 
> Fixes BMC#22767
Thanks a lot, patch applied.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH] (Re-)fix of bug #22542

2011-08-26 Thread patrik . flykt
From: Patrik Flykt 

  Hi,

Noted that the beavior is incorrect if Agent API RequestInput is cancelled.
The same code path will be called in the reopened bug BCM#22542, if there
is no agent registered. I added basically the same code as when not retrying
in ReportError, I'm almost sure the same things should be run in this case
also.

Someone with a thorough understanding of ConnMan's internals should take
a look before applying.

Cheers,

Patrik


Patrik Flykt (1):
  service: Behave properly when RequestInput is cancelled

 src/service.c |   82 ++---
 1 files changed, 43 insertions(+), 39 deletions(-)

-- 
1.7.2.5

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH] service: Behave properly when RequestInput is cancelled

2011-08-26 Thread patrik . flykt
From: Patrik Flykt 

Do the same actions on cancelling RequestInput as when
not retrying a service on ReportError.

Re-fixes BMC#22542.
---
 src/service.c |   82 ++---
 1 files changed, 43 insertions(+), 39 deletions(-)

diff --git a/src/service.c b/src/service.c
index befbe37..b9adf36 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3177,45 +3177,6 @@ static connman_bool_t get_reconnect_state(struct 
connman_service *service)
return __connman_device_get_reconnect(device);
 }
 
-static void request_input_cb (struct connman_service *service,
-   const char *identity, const char *passphrase,
-   void *user_data)
-{
-   DBG ("RequestInput return, %p", service);
-
-   if (identity == NULL && passphrase == NULL && service->wps == FALSE)
-   return;
-
-   if (identity != NULL)
-   __connman_service_set_agent_identity(service, identity);
-
-   if (passphrase != NULL) {
-   switch (service->security) {
-   case CONNMAN_SERVICE_SECURITY_WEP:
-   case CONNMAN_SERVICE_SECURITY_PSK:
-   __connman_service_set_passphrase(service, passphrase);
-   break;
-   case CONNMAN_SERVICE_SECURITY_8021X:
-   __connman_service_set_agent_passphrase(service,
-   passphrase);
-   break;
-   case CONNMAN_SERVICE_SECURITY_UNKNOWN:
-   case CONNMAN_SERVICE_SECURITY_NONE:
-   case CONNMAN_SERVICE_SECURITY_WPA:
-   case CONNMAN_SERVICE_SECURITY_RSN:
-   DBG("service security '%s' not handled",
-   security2string(service->security));
-   break;
-   }
-   }
-
-   __connman_service_connect(service);
-
-   /* Never cache agent provided credentials */
-   __connman_service_set_agent_identity(service, NULL);
-   __connman_service_set_agent_passphrase(service, NULL);
-}
-
 static DBusMessage *connect_service(DBusConnection *conn,
DBusMessage *msg, void *user_data)
 {
@@ -3976,6 +3937,49 @@ static void report_error_cb(struct connman_service 
*service,
}
 }
 
+static void request_input_cb (struct connman_service *service,
+   const char *identity, const char *passphrase,
+   void *user_data)
+{
+   DBG ("RequestInput return, %p", service);
+
+   if (identity == NULL && passphrase == NULL && service->wps == FALSE) {
+   service_complete(service);
+   services_changed(FALSE);
+   __connman_device_request_scan(CONNMAN_DEVICE_TYPE_UNKNOWN);
+   return;
+   }
+
+   if (identity != NULL)
+   __connman_service_set_agent_identity(service, identity);
+
+   if (passphrase != NULL) {
+   switch (service->security) {
+   case CONNMAN_SERVICE_SECURITY_WEP:
+   case CONNMAN_SERVICE_SECURITY_PSK:
+   __connman_service_set_passphrase(service, passphrase);
+   break;
+   case CONNMAN_SERVICE_SECURITY_8021X:
+   __connman_service_set_agent_passphrase(service,
+   passphrase);
+   break;
+   case CONNMAN_SERVICE_SECURITY_UNKNOWN:
+   case CONNMAN_SERVICE_SECURITY_NONE:
+   case CONNMAN_SERVICE_SECURITY_WPA:
+   case CONNMAN_SERVICE_SECURITY_RSN:
+   DBG("service security '%s' not handled",
+   security2string(service->security));
+   break;
+   }
+   }
+
+   __connman_service_connect(service);
+
+   /* Never cache agent provided credentials */
+   __connman_service_set_agent_identity(service, NULL);
+   __connman_service_set_agent_passphrase(service, NULL);
+}
+
 static int __connman_service_indicate_state(struct connman_service *service)
 {
enum connman_service_state old_state, new_state;
-- 
1.7.2.5

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH] service: Check NULL pointer when setting ipconfig.

2011-08-26 Thread Jukka Rissanen
Fixes BMC#22766
---
Hi,

this fixes the bug https://bugs.meego.com/show_bug.cgi?id=22766
where we must check if the ipconfig is NULL before trying
to access it. The problem happened as 3G connection did not have
an IPv6 address.

Jukka


 src/service.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/service.c b/src/service.c
index 8152b73..dff62ae 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2286,6 +2286,9 @@ static int set_ipconfig(struct connman_service *service,
enum connman_ipconfig_type type;
int err;
 
+   if (ipconfig == NULL)
+   return -EINVAL;
+
old_method = __connman_ipconfig_get_method(ipconfig);
 
if (is_connecting_state(service, state) ||
-- 
1.7.1

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH] network: Read only the ipconfig data if we have no address.

2011-08-26 Thread Jukka Rissanen
We must not read ipconfig data from file if there is already a valid
address that was set by service set_property().

Fixes BMC#22767
---
Hi,

the following patches fix the bug https://bugs.meego.com/show_bug.cgi?id=22767
where user is unable to set manual ipaddress. The bug is about IPv6 but
the same applies also to IPv4 if the ipconfig method is set to OFF.

Jukka


 src/network.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/network.c b/src/network.c
index b8175a5..ffbf220 100644
--- a/src/network.c
+++ b/src/network.c
@@ -890,10 +890,11 @@ static void set_connected_manual(struct connman_network 
*network)
 
service = __connman_service_lookup_from_network(network);
 
-   __connman_service_read_ip4config(service);
-
ipconfig = __connman_service_get_ip4config(service);
 
+   if (__connman_ipconfig_get_local(ipconfig) == NULL)
+   __connman_service_read_ip4config(service);
+
set_configuration(network);
 
err = __connman_ipconfig_address_add(ipconfig);
@@ -945,7 +946,8 @@ static int manual_ipv6_set(struct connman_network *network,
if (service == NULL)
return -EINVAL;
 
-   __connman_service_read_ip6config(service);
+   if (__connman_ipconfig_get_local(ipconfig_ipv6) == NULL)
+   __connman_service_read_ip6config(service);
 
err = __connman_ipconfig_address_add(ipconfig_ipv6);
if (err < 0) {
-- 
1.7.1

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH] service: Do not allow service to be moved before a VPN service.

2011-08-26 Thread Jukka Rissanen
This is needed as the default routes are not set properly
if we allow a service to be moved before a VPN service.
---
Hi,

it would be nice to allow a service to be moved before VPN service
but unfortunately it would require bigger changes in connection.c
so atm just disallow this.

Jukka


 src/service.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/service.c b/src/service.c
index fab0cd7..8152b73 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2916,7 +2916,8 @@ static DBusMessage *move_service(DBusConnection *conn,
return __connman_error_not_supported(msg);
 
target = find_service(path);
-   if (target == NULL || target->favorite == FALSE || target == service)
+   if (target == NULL || target->favorite == FALSE || target == service ||
+   target->type == CONNMAN_SERVICE_TYPE_VPN)
return __connman_error_invalid_service(msg);
 
target4 = __connman_ipconfig_get_method(target->ipconfig_ipv4);
-- 
1.7.1

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman