Fix the same static IP setting from DHCP

When the BMC already has a DHCP IP address, and we set the same static
IP address, it fails.

It is because the AddressMap is a std::map and the code was using
emplace() to add the new created IP address. If the address is already
in the map, the emplace() does not replace the object but does nothing.

Change the emplace() to insert_or_assign(), so that the newly created IP
address is added into the map.

Resolves: openbmc/phosphor-networkd#38
Tested: Verify the static IP address could be set.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Ic6756c81c4981589c8bbe88e990304ed1df6b59a
1 file changed