Fix update of Ethernet address and MTU values
[framework/connectivity/connman.git] / src / ipconfig.c
index 1298a78..45764f5 100644 (file)
@@ -331,6 +331,12 @@ void __connman_ipconfig_newlink(int index, unsigned short type,
                                                index, type, type2str(type));
 
 update:
+       if (ipdevice->config != NULL) {
+               g_free(ipdevice->config->eth);
+               ipdevice->config->eth = g_strdup(address);
+               ipdevice->config->mtu = mtu;
+       }
+
        if (flags == ipdevice->flags)
                return;
 
@@ -379,10 +385,6 @@ update:
                if (index != ipconfig->index)
                        continue;
 
-               g_free(ipconfig->eth);
-               ipconfig->eth = g_strdup(address);
-               ipconfig->mtu = mtu;
-
                if (up == TRUE && ipconfig->ops->up)
                        ipconfig->ops->up(ipconfig);
                if (lower_up == TRUE && ipconfig->ops->lower_up)