summaryrefslogtreecommitdiffstats
path: root/ethernet_interface.cpp
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@in.ibm.com>2017-08-02 07:04:16 +0530
committerPatrick Williams <patrick@stwcx.xyz>2017-08-13 11:31:58 +0000
commite578d56af4de7a046cf054d0961c56ed5a904129 (patch)
tree6c081e94d824f6f7c20c0ba25d275d18e4b03714 /ethernet_interface.cpp
parentdea3ead09a1503daec471d8ed4d24d20bb489451 (diff)
downloadphosphor-networkd-e578d56af4de7a046cf054d0961c56ed5a904129.tar.gz
phosphor-networkd-e578d56af4de7a046cf054d0961c56ed5a904129.zip
Change the pointer type of ip address object
Make the ip address pointer shared as it was declared as shared, but during creation of object it was being created as unique. It is required to be shared as the ip addresses is being exposed through API to network manager. Change-Id: Id520e89b1105dddb7178be638ce708eeeefa5be3 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'ethernet_interface.cpp')
-rw-r--r--ethernet_interface.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index f29c482..3070670 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -79,9 +79,8 @@ void EthernetInterface::createIPAddressObjects()
gateway);
this->addrs.emplace(
- std::make_pair(
- addr.ipaddress,
- std::make_unique<phosphor::network::IPAddress>(
+ std::move(addr.ipaddress),
+ std::make_shared<phosphor::network::IPAddress>(
bus,
ipAddressObjectPath.c_str(),
*this,
@@ -89,7 +88,7 @@ void EthernetInterface::createIPAddressObjects()
addr.ipaddress,
origin,
addr.prefix,
- gateway)));
+ gateway));
}
}
@@ -115,16 +114,16 @@ void EthernetInterface::iP(IP::Protocol protType,
gateway);
this->addrs.emplace(
- std::make_pair(ipaddress,
- std::make_unique<phosphor::network::IPAddress>(
- bus,
- objectPath.c_str(),
- *this,
- protType,
- ipaddress,
- origin,
- prefixLength,
- gateway)));
+ std::move(ipaddress),
+ std::make_shared<phosphor::network::IPAddress>(
+ bus,
+ objectPath.c_str(),
+ *this,
+ protType,
+ ipaddress,
+ origin,
+ prefixLength,
+ gateway));
manager.writeToConfigurationFile();
}
OpenPOWER on IntegriCloud