summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-02-22 13:47:53 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-22 14:43:29 +0200
commitf6d8001a4bf4293dfe012cb8065f76ce3501a7a5 (patch)
tree6a3a31db1a62cf1d476964c2c564632e656c0011
parentc7b990c3ee3af249d027696c2b0f35c389df0271 (diff)
downloadconnman-f6d8001a4bf4293dfe012cb8065f76ce3501a7a5.tar.gz
connman-f6d8001a4bf4293dfe012cb8065f76ce3501a7a5.tar.bz2
connman-f6d8001a4bf4293dfe012cb8065f76ce3501a7a5.zip
ipconfig: Add function to set the IPv6 privacy option
-rw-r--r--src/connman.h2
-rw-r--r--src/ipconfig.c19
2 files changed, 21 insertions, 0 deletions
diff --git a/src/connman.h b/src/connman.h
index 8c167981..1f74e238 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -362,6 +362,8 @@ int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
int __connman_ipconfig_save(struct connman_ipconfig *ipconfig,
GKeyFile *keyfile, const char *identifier, const char *prefix);
gboolean __connman_ipconfig_ipv6_privacy_enabled(struct connman_ipconfig *ipconfig);
+int __connman_ipconfig_ipv6_set_privacy(struct connman_ipconfig *ipconfig,
+ const char *value);
int __connman_ipconfig_set_rp_filter();
void __connman_ipconfig_unset_rp_filter(int old_value);
diff --git a/src/ipconfig.c b/src/ipconfig.c
index 06c488af..6927936f 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1718,6 +1718,25 @@ static int string2privacy(const char *privacy)
return 0;
}
+int __connman_ipconfig_ipv6_set_privacy(struct connman_ipconfig *ipconfig,
+ const char *value)
+{
+ int privacy;
+
+ if (ipconfig == NULL)
+ return -EINVAL;
+
+ DBG("ipconfig %p privacy %s", ipconfig, value);
+
+ privacy = string2privacy(value);
+
+ ipconfig->ipv6_privacy_config = privacy;
+
+ enable_ipv6(ipconfig);
+
+ return 0;
+}
+
void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
DBusMessageIter *iter)
{