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 /ethernet_interface.cpp | |
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>
Diffstat (limited to 'ethernet_interface.cpp')
-rw-r--r-- | ethernet_interface.cpp | 26 |
1 files changed, 6 insertions, 20 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"; } |