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/utils.cpp b/utils.cpp
index ea3a6aa..fa6bd04 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -96,10 +96,10 @@
 
 }
 
-std::string getIPAddress(sdbusplus::bus::bus& bus,
-                         const std::string& interface,
-                         const std::string& serviceRoot,
-                         const std::string& match)
+DbusObjectInfo getIPObject(sdbusplus::bus::bus& bus,
+                           const std::string& interface,
+                           const std::string& serviceRoot,
+                           const std::string& match)
 {
     auto objectTree = getAllDbusObjects(bus, serviceRoot, interface, match);
 
@@ -110,7 +110,7 @@
         elog<InternalFailure>();
     }
 
-    std::string ipaddress;
+    DbusObjectInfo objectInfo;
 
     for (auto& object : objectTree)
     {
@@ -121,10 +121,10 @@
                            ipmi::network::IP_INTERFACE,
                            "Address");
 
-        ipaddress = std::move(variant.get<std::string>());
+        objectInfo =  std::make_pair(object.first, object.second.begin()->first);
 
         // if LinkLocalIP found look for Non-LinkLocalIP
-        if (ipmi::network::isLinkLocalIP(ipaddress))
+        if (ipmi::network::isLinkLocalIP(variant.get<std::string>()))
         {
             continue;
         }
@@ -132,11 +132,8 @@
         {
             break;
         }
-
     }
-
-    return ipaddress;
-
+    return objectInfo;
 }
 
 Value getDbusProperty(sdbusplus::bus::bus& bus,