From f5b31a03d2bdc743510ed96a314e60a9899ac986 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 19 Dec 2009 14:09:28 -0800 Subject: [PATCH] Add address and netmask configuration to settings --- src/ipconfig.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ipconfig.c b/src/ipconfig.c index 43d41da..15fe2f0 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -906,6 +906,21 @@ void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig, return; append_basic(iter, prefix, "Method", DBUS_TYPE_STRING, &str); + + if (ipconfig->address == NULL) + return; + + if (ipconfig->address->local != NULL) { + struct in_addr netmask; + char *mask; + + append_basic(iter, prefix, "Address", + DBUS_TYPE_STRING, &ipconfig->address->local); + + netmask.s_addr = ~0 << (32 - ipconfig->address->prefixlen); + mask = inet_ntoa(netmask); + append_basic(iter, prefix, "Netmask", DBUS_TYPE_STRING, &mask); + } } int __connman_ipconfig_set_ipv4(struct connman_ipconfig *ipconfig, -- 2.7.4