From: Pasi Sjöholm <pasi.sjoh...@jollamobile.com>

IPv6 configuration method is either CONNMAN_IPCONFIG_METHOD_FIXED
(ipv6-pdp) or CONNMAN_IPCONFIG_METHOD_AUTO (SLAAC/DHCPv6,
dual/ipv4v6-pdp).
---
 plugins/ofono.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index db162a9..8233656 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -920,19 +920,25 @@ static void extract_ipv6_settings(DBusMessageIter *array,
        if (index < 0)
                goto out;
 
-       context->ipv6_method = CONNMAN_IPCONFIG_METHOD_FIXED;
+       if (address) {
 
-       context->ipv6_address =
-               connman_ipaddress_alloc(CONNMAN_IPCONFIG_TYPE_IPV6);
-       if (!context->ipv6_address)
-               goto out;
+               context->ipv6_address =
+                       connman_ipaddress_alloc(CONNMAN_IPCONFIG_TYPE_IPV6);
+               if (!context->ipv6_address)
+                       goto out;
 
-       context->index = index;
-       connman_ipaddress_set_ipv6(context->ipv6_address, address,
-                               prefix_length, gateway);
+               context->ipv6_method = CONNMAN_IPCONFIG_METHOD_FIXED;
 
-       g_free(context->ipv6_nameservers);
-       context->ipv6_nameservers = nameservers;
+               context->index = index;
+               connman_ipaddress_set_ipv6(context->ipv6_address, address,
+                                       prefix_length, gateway);
+
+               g_free(context->ipv6_nameservers);
+               context->ipv6_nameservers = nameservers;
+       } else {
+               context->index = index;
+               context->ipv6_method = CONNMAN_IPCONFIG_METHOD_AUTO;
+       }
 
 out:
        if (context->ipv6_nameservers != nameservers)
-- 
2.1.0

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to