diff options
author | Ratan Gupta <ratagupt@in.ibm.com> | 2017-12-19 18:03:23 +0530 |
---|---|---|
committer | Tom Joseph <tomjoseph@in.ibm.com> | 2018-01-17 15:06:28 +0000 |
commit | dfd8469745f6b9a4534c0f07a8df32d3985d115d (patch) | |
tree | 5af001bf83be95619844324c8720c7c7adc28de5 | |
parent | c01edf283dca792d1eecedd5c03b69b7eebb6f23 (diff) | |
download | phosphor-host-ipmid-dfd8469745f6b9a4534c0f07a8df32d3985d115d.tar.gz phosphor-host-ipmid-dfd8469745f6b9a4534c0f07a8df32d3985d115d.zip |
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>
-rw-r--r-- | app/channel.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
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_ret_t ipmi_set_channel_access(ipmi_netfn_t netfn, 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 @@ ipmi_ret_t ipmi_set_channel_access(ipmi_netfn_t netfn, 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. |