LANConf: Minor Fixes

1) Get the interface mode of the system if it is not given
    so that we can set the same interface mode as it was before.
2) Removed the unnecessary condition of getting the VLAN.

Resolves openbmc/openbmc#2738

Change-Id: I1658fbf78627e7cc1c7e1e5875964ed30c58d6dc
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/app/channel.cpp b/app/channel.cpp
index 64cc6e9..283188c 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -176,6 +176,15 @@
                     ipmi::network::ETHERNET_INTERFACE,
                     "DHCPEnabled").get<bool>();
 
+            // if ip address source is not given then get the ip source mode
+            // from the system so that it can be applied later.
+            if (channelConf->ipsrc == ipmi::network::IPOrigin::UNSPECIFIED)
+            {
+                channelConf->ipsrc = (enableDHCP) ?
+                    ipmi::network::IPOrigin::DHCP :
+                    ipmi::network::IPOrigin::STATIC;
+            }
+
             // check whether user has given all the data
             // or the configured system interface is dhcp enabled,
             // in both of the cases get the values from the cache.
@@ -188,18 +197,6 @@
                 ipaddress = channelConf->ipaddr;
                 prefix = ipmi::network::toPrefix(AF_INET, channelConf->netmask);
                 gateway = channelConf->gateway;
-                if (channelConf->vlanID != ipmi::network::VLAN_ID_MASK)
-                {
-                    //get the first twelve bits which is vlan id
-                    //not interested in rest of the bits.
-                    channelConf->vlanID = le32toh(channelConf->vlanID);
-                    vlanID = channelConf->vlanID & ipmi::network::VLAN_ID_MASK;
-                }
-                else
-                {
-                    vlanID = ipmi::network::getVLAN(networkInterfacePath);
-                }
-
             }
             else // asked ip src = static and configured system src = static
                 // or partially given data.