Fix the getLan config

We did the filtering during IPAddress parameter
to avoid link local address but left it for subnetMask
and vlan parameter.
With the introduction of zeroconfig IP we have
multiIPaddress can exist on the interface.
This commit introduces the filtering for subnetmask and
vlan parameter also.

Resolves openbmc/openbmc#2664

Change-Id: I244bfe8b9d7efbf55fc1b7051489a8a204182906
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/app/channel.cpp b/app/channel.cpp
index 72f1571..91d9987 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -97,10 +97,11 @@
 
                 // if the system is having ip object,then
                 // get the IP object.
-                ipObject = ipmi::getDbusObject(bus,
-                                               ipmi::network::IP_INTERFACE,
-                                               ipmi::network::ROOT,
-                                               ipmi::network::IP_TYPE);
+                ipObject = ipmi::getIPObject(
+                                bus,
+                                ipmi::network::IP_INTERFACE,
+                                ipmi::network::ROOT,
+                                ipmi::network::IP_TYPE);
 
                 // Get the parent interface of the IP object.
                 try
@@ -196,11 +197,8 @@
                             ipmi::network::IP_INTERFACE);
 
                     ipaddress = channelConfig.ipaddr.empty() ?
-                                ipmi::getIPAddress(bus,
-                                                   ipmi::network::IP_INTERFACE,
-                                                   ipmi::network::ROOT,
-                                                   ipmi::network::IP_TYPE) :
-                                channelConfig.ipaddr;
+                        properties["Address"].get<std::string>() :
+                        channelConfig.ipaddr;
 
                     prefix = channelConfig.netmask.empty() ?
                         properties["PrefixLength"].get<uint8_t>() :