This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 src/element.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 0f7286042151b6fa69570a0990dc5400ac8ca70c
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Thu Dec 4 22:09:25 2008 +0100

    Add proper IPv4 attributes


Diff in this email is a maximum of 400 lines.
diff --git a/src/element.c b/src/element.c
index 53f4cb9..72b0467 100644
--- a/src/element.c
+++ b/src/element.c
@@ -183,21 +183,29 @@ static void append_property(DBusMessageIter *dict,
 static void add_common_properties(struct connman_element *element,
                                                DBusMessageIter *dict)
 {
+       const char *address = NULL, *netmask = NULL, *gateway = NULL;
        GSList *list;
 
+       connman_element_get_value(element,
+                               CONNMAN_PROPERTY_ID_IPV4_ADDRESS, &address);
+       connman_element_get_value(element,
+                               CONNMAN_PROPERTY_ID_IPV4_NETMASK, &netmask);
+       connman_element_get_value(element,
+                               CONNMAN_PROPERTY_ID_IPV4_GATEWAY, &gateway);
+
        if (element->priority > 0)
                connman_dbus_dict_append_variant(dict, "Priority",
                                        DBUS_TYPE_UINT16, &element->priority);
 
-       if (element->ipv4.address != NULL)
+       if (address != NULL)
                connman_dbus_dict_append_variant(dict, "IPv4.Address",
-                               DBUS_TYPE_STRING, &element->ipv4.address);
-       if (element->ipv4.netmask != NULL)
+                                               DBUS_TYPE_STRING, &address);
+       if (netmask != NULL)
                connman_dbus_dict_append_variant(dict, "IPv4.Netmask",
-                               DBUS_TYPE_STRING, &element->ipv4.netmask);
-       if (element->ipv4.gateway != NULL)
+                                               DBUS_TYPE_STRING, &netmask);
+       if (gateway != NULL)
                connman_dbus_dict_append_variant(dict, "IPv4.Gateway",
-                               DBUS_TYPE_STRING, &element->ipv4.gateway);
+                                               DBUS_TYPE_STRING, &gateway);
 
        if (element->wifi.security != NULL) {
                const char *passphrase = "";
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to