diff options
author | Ratan K Gupta <ratagupt@linux.vnet.ibm.com> | 2018-09-15 00:49:51 -0400 |
---|---|---|
committer | Ratan K Gupta <ratagupt@linux.vnet.ibm.com> | 2018-09-15 01:56:00 -0400 |
commit | 1a054aeab10d7cf32df704d256fa317fffa63026 (patch) | |
tree | 945004fd445c7de6e655fefa66b02ab11da0597b | |
parent | 57d9c5066e2fc28d3e89b1bd9fd3ee98e27c4c48 (diff) | |
download | phosphor-networkd-1a054aeab10d7cf32df704d256fa317fffa63026.tar.gz phosphor-networkd-1a054aeab10d7cf32df704d256fa317fffa63026.zip |
Fix formatting issues
Some of the formatting issues which brought by the
earlier commit(clang-formatting) is fixed with this
commit.
Signed-off-by: Ratan K Gupta <ratagupt@linux.vnet.ibm.com>
-rw-r--r-- | ethernet_interface.cpp | 26 | ||||
-rw-r--r-- | ethernet_interface.hpp | 1 | ||||
-rw-r--r-- | vlan_interface.cpp | 10 |
3 files changed, 9 insertions, 28 deletions
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp index 19dfec4..3fd7835 100644 --- a/ethernet_interface.cpp +++ b/ethernet_interface.cpp @@ -158,14 +158,8 @@ TODO: https://github.com/openbmc/openbmc/issues/1484 InterfaceInfo EthernetInterface::getInterfaceInfo() const { int sock{-1}; - struct ifreq ifr - { - 0 - }; - struct ethtool_cmd edata - { - 0 - }; + ifreq ifr{0}; + ethtool_cmd edata{0}; LinkSpeed speed{0}; Autoneg autoneg{0}; DuplexMode duplex{0}; @@ -209,9 +203,7 @@ InterfaceInfo EthernetInterface::getInterfaceInfo() const std::string EthernetInterface::getMACAddress(const std::string& interfaceName) const { - struct ifreq ifr - { - }; + ifreq ifr{}; char macAddress[mac_address::size]{}; int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); @@ -511,17 +503,13 @@ void EthernetInterface::writeConfigurationFile() } // Write the device - stream << "[" - << "Match" - << "]\n"; + stream << "[Match]\n"; stream << "Name=" << interfaceName() << "\n"; auto addrs = getAddresses(); // write the network section - stream << "[" - << "Network" - << "]\n"; + stream << "[Network]\n"; #ifdef LINK_LOCAL_AUTOCONFIGURATION stream << "LinkLocalAddressing=yes\n"; #else @@ -595,9 +583,7 @@ void EthernetInterface::writeConfigurationFile() addr.second->gateway() != "" && destination != "0.0.0.0" && destination != "") { - stream << "[" - << "Route" - << "]\n"; + stream << "[Route]\n"; stream << "Gateway=" << addr.second->gateway() << "\n"; stream << "Destination=" << destination << "\n"; } diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp index 8dad0e9..bfe1d54 100644 --- a/ethernet_interface.hpp +++ b/ethernet_interface.hpp @@ -205,7 +205,6 @@ class EthernetInterface : public Ifaces /** @brief write the dhcp section **/ void writeDHCPSection(std::fstream& stream); - ; /** @brief get the NTP server list from the network conf * diff --git a/vlan_interface.cpp b/vlan_interface.cpp index 6ef1a0c..1b4eaee 100644 --- a/vlan_interface.cpp +++ b/vlan_interface.cpp @@ -56,14 +56,10 @@ void VlanInterface::writeDeviceFile() elog<InternalFailure>(); } - stream << "[" - << "NetDev" - << "]\n"; + stream << "[NetDev]\n"; stream << "Name=" << EthernetInterface::interfaceName() << "\n"; - stream << "Kind=vlan" - << "\n"; - stream << "[VLAN]" - << "\n"; + stream << "Kind=vlan\n"; + stream << "[VLAN]\n"; stream << "Id=" << id() << "\n"; stream.close(); } |