summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortaesub.kim <taesub.kim@samsung.com>2015-10-06 11:04:26 +0900
committertaesub.kim <taesub.kim@samsung.com>2015-10-06 11:04:49 +0900
commit811c8790cfc2a5cf3806558be7aecac544037ebb (patch)
tree964bc79dfe5a78b468b4d0cadb50c3c9711591e2 /src
parent8b4bc4bc6b4dc5f2a5723421bd7da133647c3ce0 (diff)
downloadconnman-811c8790cfc2a5cf3806558be7aecac544037ebb.tar.gz
connman-811c8790cfc2a5cf3806558be7aecac544037ebb.tar.bz2
connman-811c8790cfc2a5cf3806558be7aecac544037ebb.zip
Change-Id: I02fc50820cccc66aed702a97a9928981e73b43cf Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/connection.c9
-rwxr-xr-xsrc/connman.service.in3
-rwxr-xr-xsrc/dnsproxy.c6
-rwxr-xr-xsrc/ipconfig.c10
-rwxr-xr-xsrc/network.c3
-rwxr-xr-xsrc/service.c60
6 files changed, 87 insertions, 4 deletions
diff --git a/src/connection.c b/src/connection.c
index aa4e1c05..db79ac79 100755
--- a/src/connection.c
+++ b/src/connection.c
@@ -1022,6 +1022,9 @@ bool __connman_connection_update_gateway(void)
bool updated = false;
GHashTableIter iter;
gpointer value, key;
+#if defined TIZEN_EXT
+ static struct gateway_data *old_default = NULL;
+#endif
if (!gateway_hash)
return updated;
@@ -1063,6 +1066,12 @@ bool __connman_connection_update_gateway(void)
}
}
+#if defined TIZEN_EXT
+ if (updated == false && old_default != default_gateway) {
+ updated = true;
+ old_default = default_gateway;
+ }
+#endif
if (updated && default_gateway) {
if (default_gateway->ipv4_gateway)
set_default_gateway(default_gateway,
diff --git a/src/connman.service.in b/src/connman.service.in
index c079054c..b55c571f 100755
--- a/src/connman.service.in
+++ b/src/connman.service.in
@@ -1,6 +1,7 @@
[Unit]
Description=Connection service
-After=tizen-system.target shutdown.target
+After=net-config.service
+DefaultDependencies=no
[Service]
Type=dbus
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index f5ec5021..6e1870f6 100755
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2586,7 +2586,7 @@ static void destroy_server_sec(struct server_data *server)
GList *list;
int fd;
- if(server->channel)
+ if (server->channel)
fd = g_io_channel_unix_get_fd(server->channel);
else
fd = -1;
@@ -2594,8 +2594,10 @@ static void destroy_server_sec(struct server_data *server)
DBG("index %d server %s sock %d", server->index, server->server, fd);
server_list_sec = g_slist_remove(server_list_sec, server);
- if(fd > 0)
+
+ if (fd > 0)
close(fd);
+
server_destroy_socket(server);
if (server->protocol == IPPROTO_UDP && server->enabled)
diff --git a/src/ipconfig.c b/src/ipconfig.c
index 5d6da915..8987ab1a 100755
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1845,6 +1845,11 @@ void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
case CONNMAN_IPCONFIG_METHOD_MANUAL:
case CONNMAN_IPCONFIG_METHOD_DHCP:
append_addr = ipconfig->system;
+#if defined TIZEN_EXT
+ /* TIZEN enables get_properties before __connman_ipconfig_newaddr */
+ if (append_addr && append_addr->local == NULL)
+ append_addr = ipconfig->address;
+#endif
break;
}
@@ -1908,6 +1913,11 @@ void __connman_ipconfig_append_ipv6(struct connman_ipconfig *ipconfig,
case CONNMAN_IPCONFIG_METHOD_DHCP:
case CONNMAN_IPCONFIG_METHOD_AUTO:
append_addr = ipconfig->system;
+#if defined TIZEN_EXT
+ /* TIZEN enables get_properties before __connman_ipconfig_newaddr */
+ if (append_addr && append_addr->local == NULL)
+ append_addr = ipconfig->address;
+#endif
break;
}
diff --git a/src/network.c b/src/network.c
index f928b6af..ad677467 100755
--- a/src/network.c
+++ b/src/network.c
@@ -1355,7 +1355,8 @@ int connman_network_set_associating(struct connman_network *network,
}
#if defined TIZEN_EXT
- if (associating == FALSE)
+ if (associating == FALSE &&
+ connman_network_get_bool(network, "WiFi.UseWPS") == FALSE)
g_timeout_add_seconds(1,
__connman_network_clear_associating_delayed,
network);
diff --git a/src/service.c b/src/service.c
index 320e7cc9..1ee4c4c0 100755
--- a/src/service.c
+++ b/src/service.c
@@ -4040,6 +4040,14 @@ static void set_error(struct connman_service *service,
DBUS_TYPE_STRING, &str);
}
+static void set_idle(struct connman_service *service)
+{
+ service->state = service->state_ipv4 = service->state_ipv6 =
+ CONNMAN_SERVICE_STATE_IDLE;
+ set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
+ state_changed(service);
+}
+
static DBusMessage *clear_property(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
@@ -4344,7 +4352,23 @@ void __connman_service_auto_connect(enum connman_service_connect_reason reason)
if (!__connman_session_policy_autoconnect(reason))
return;
+#if defined TIZEN_EXT
+ /* Adding Timeout of 500ms before trying to auto connect.
+ * This is done because of below scenario
+ * 1. Device is connected to AP1
+ * 2. WPS Connection request is initiated for AP2
+ * 3. Immediately WPS Connection is Cancelled
+ * When WPS Connection Connection is initiated for AP2 then
+ * sometimes there is a scenario where connman gets in ASSOCIATED
+ * state with AP1 due to autoconnect and subsequently the connection
+ * initiated by AP1 fails and connman service for AP1 comes in
+ * FAILURE state due to this when connection with AP2 is cancelled
+ * then autoconnect with AP1 doesn't works because its autoconnection
+ * is ignored as its last state was FAILURE rather than IDLE */
+ autoconnect_timeout = g_timeout_add(500, run_auto_connect,
+#else
autoconnect_timeout = g_timeout_add_seconds(0, run_auto_connect,
+#endif
GUINT_TO_POINTER(reason));
}
@@ -4696,6 +4720,38 @@ bool __connman_service_remove(struct connman_service *service)
g_free(service->eap);
service->eap = NULL;
+#if defined TIZEN_EXT
+ g_free(service->ca_cert_file);
+ service->ca_cert_file = NULL;
+
+ g_free(service->client_cert_file);
+ service->client_cert_file = NULL;
+
+ g_free(service->private_key_file);
+ service->private_key_file = NULL;
+
+ g_free(service->private_key_passphrase);
+ service->private_key_passphrase = NULL;
+
+ g_free(service->phase2);
+ service->phase2 = NULL;
+
+ __connman_ipconfig_set_method(service->ipconfig_ipv4, CONNMAN_IPCONFIG_METHOD_DHCP);
+ __connman_ipconfig_set_method(service->ipconfig_ipv6, CONNMAN_IPCONFIG_METHOD_AUTO);
+ connman_service_set_proxy(service, NULL, false);
+
+ __connman_service_nameserver_clear(service);
+
+ g_strfreev(service->nameservers_config);
+ service->nameservers_config = NULL;
+
+#endif
+
+#if defined TIZEN_EXT
+ if (service->security != CONNMAN_SERVICE_SECURITY_8021X)
+#endif
+ set_idle(service);
+
service->error = CONNMAN_SERVICE_ERROR_UNKNOWN;
service->user.favorite_user = USER_NONE;
@@ -4704,7 +4760,11 @@ bool __connman_service_remove(struct connman_service *service)
__connman_ipconfig_ipv6_reset_privacy(service->ipconfig_ipv6);
+#if defined TIZEN_EXT
+ __connman_storage_remove_service(service->identifier);
+#else
service_save(service);
+#endif
return true;
}