summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dhcp.c8
-rw-r--r--src/main.c15
-rwxr-xr-xsrc/main.conf9
3 files changed, 32 insertions, 0 deletions
diff --git a/src/dhcp.c b/src/dhcp.c
index 16f59b74..951836fd 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -284,6 +284,14 @@ static void no_lease_cb(GDHCPClient *dhcp_client, gpointer user_data)
DBG("No lease available ipv4ll %d client %p", dhcp->ipv4ll_running,
dhcp->ipv4ll_client);
+#if defined TIZEN_EXT
+ if (connman_setting_get_bool("EnableAutoIp") == false) {
+ DBG("link-local address autoconfiguration is disabled.");
+ if (dhcp->network)
+ __connman_network_disconnect(dhcp->network);
+ return;
+ }
+#endif
if (dhcp->timeout > 0)
g_source_remove(dhcp->timeout);
diff --git a/src/main.c b/src/main.c
index 8221c35a..0e603b8f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -96,6 +96,7 @@ static struct {
#if defined TIZEN_EXT
char **cellular_interfaces;
bool tizen_tv_extension;
+ bool auto_ip;
#endif
} connman_settings = {
.bg_scan = true,
@@ -122,6 +123,7 @@ static struct {
#if defined TIZEN_EXT
.cellular_interfaces = NULL,
.tizen_tv_extension = false,
+ .auto_ip = true,
#endif
};
@@ -149,6 +151,7 @@ static struct {
#if defined TIZEN_EXT
#define CONF_CELLULAR_INTERFACE "NetworkCellularInterfaceList"
#define CONF_TIZEN_TV_EXT "TizenTVExtension"
+#define CONF_ENABLE_AUTO_IP "EnableAutoIp"
#endif
static const char *supported_options[] = {
@@ -312,6 +315,13 @@ static void check_Tizen_configuration(GKeyFile *config)
connman_settings.tizen_tv_extension = boolean;
g_clear_error(&error);
+
+ boolean = __connman_config_get_bool(config, "General",
+ CONF_ENABLE_AUTO_IP, &error);
+ if (!error)
+ connman_settings.auto_ip = boolean;
+
+ g_clear_error(&error);
}
static void set_nofile_inc(void)
@@ -760,6 +770,11 @@ bool connman_setting_get_bool(const char *key)
if (g_str_equal(key, CONF_USE_GATEWAYS_AS_TIMESERVERS))
return connman_settings.use_gateways_as_timeservers;
+#if defined TIZEN_EXT
+ if (g_str_equal(key, CONF_ENABLE_AUTO_IP))
+ return connman_settings.auto_ip;
+#endif
+
return false;
}
diff --git a/src/main.conf b/src/main.conf
index c3190ca3..f40ac13a 100755
--- a/src/main.conf
+++ b/src/main.conf
@@ -154,3 +154,12 @@ SingleConnectedTechnology = true
# AddressConflictDetection = false
NetworkCellularInterfaceList = pdp,rmnet,seth_td,seth_w
+
+# Enable use of link-local address for auto-configuration.
+# When a device fails to get IP address from DHCP server,
+# ConnMan will start link-local address autoconfiguration and
+# assign a link-local IP address to device.
+# If this setting is false and device fails to get IP address
+# from DHCP server then device state will be set to disconnected.
+# Default value is true.
+# EnableAutoIp = false