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

---
 plugins/ofono.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index 29dfe90..db162a9 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -826,20 +826,23 @@ static void extract_ipv4_settings(DBusMessageIter *array,
 
        context->index = index;
 
-       if (context->ipv4_method != CONNMAN_IPCONFIG_METHOD_FIXED)
-               goto out;
+       if (address) {
 
-       context->ipv4_address = 
connman_ipaddress_alloc(CONNMAN_IPCONFIG_TYPE_IPV4);
-       if (!context->ipv4_address) {
-               context->index = -1;
-               goto out;
-       }
+               if (context->ipv4_method != CONNMAN_IPCONFIG_METHOD_FIXED)
+                       goto out;
 
-       connman_ipaddress_set_ipv4(context->ipv4_address, address,
-                               netmask, gateway);
+               context->ipv4_address = 
connman_ipaddress_alloc(CONNMAN_IPCONFIG_TYPE_IPV4);
+               if (!context->ipv4_address) {
+                       context->index = -1;
+                       goto out;
+               }
 
-       g_free(context->ipv4_nameservers);
-       context->ipv4_nameservers = nameservers;
+               connman_ipaddress_set_ipv4(context->ipv4_address, address,
+                                       netmask, gateway);
+
+               g_free(context->ipv4_nameservers);
+               context->ipv4_nameservers = nameservers;
+       }
 
 out:
        if (context->ipv4_nameservers != nameservers)
-- 
2.1.0

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

Reply via email to