ipconfig: Set IPv6 privacy default value from kernel default
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Wed, 6 Jun 2012 11:37:32 +0000 (14:37 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 11 Jun 2012 10:30:18 +0000 (13:30 +0300)
Use value set in the kernel as the initial IPv6 privacy
setting. This also allows distros to set the privacy value
without needing to tweak connman.

src/ipconfig.c

index 3b85827..b401c23 100644 (file)
@@ -1245,6 +1245,7 @@ void __connman_ipconfig_set_prefixlen(struct connman_ipconfig *ipconfig, unsigne
 static struct connman_ipconfig *create_ipv6config(int index)
 {
        struct connman_ipconfig *ipv6config;
 static struct connman_ipconfig *create_ipv6config(int index)
 {
        struct connman_ipconfig *ipv6config;
+       struct connman_ipdevice *ipdevice;
 
        DBG("index %d", index);
 
 
        DBG("index %d", index);
 
@@ -1258,7 +1259,10 @@ static struct connman_ipconfig *create_ipv6config(int index)
        ipv6config->enabled = FALSE;
        ipv6config->type = CONNMAN_IPCONFIG_TYPE_IPV6;
        ipv6config->method = CONNMAN_IPCONFIG_METHOD_AUTO;
        ipv6config->enabled = FALSE;
        ipv6config->type = CONNMAN_IPCONFIG_TYPE_IPV6;
        ipv6config->method = CONNMAN_IPCONFIG_METHOD_AUTO;
-       ipv6config->ipv6_privacy_config = 0;
+
+       ipdevice = g_hash_table_lookup(ipdevice_hash, GINT_TO_POINTER(index));
+       if (ipdevice != NULL)
+               ipv6config->ipv6_privacy_config = ipdevice->ipv6_privacy;
 
        ipv6config->address = connman_ipaddress_alloc(AF_INET6);
        if (ipv6config->address == NULL) {
 
        ipv6config->address = connman_ipaddress_alloc(AF_INET6);
        if (ipv6config->address == NULL) {