Fix representation IPv6 DNS servers
The `getNameServerFromResolvd` function ignores the family type of
address received from `systemd-resolvd`. It leads to an incorrect
representation of IPv6 addresses.
This commit fixes that.
Resolves openbmc/phosphor-networkd#34
Testing:
Add an IPv6 DNS server:
```
busctl set-property xyz.openbmc_project.Network \
/xyz/openbmc_project/network/eth0 \
xyz.openbmc_project.Network.EthernetInterface \
StaticNameServers as 1 2001:db8:1::1
```
After the setting will be applied the `Nameservers` property must
contain valid representation:
```
busctl get-property xyz.openbmc_project.Network \
/xyz/openbmc_project/network/eth0 \
xyz.openbmc_project.Network.EthernetInterface \
Nameservers
as 1 "2001:db8:1::1"
```
Change-Id: Id69a0ffcceedd5be28e26ea9b9aca7f37e6a9345
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
diff --git a/util.hpp b/util.hpp
index 05c400b..7e1aab6 100644
--- a/util.hpp
+++ b/util.hpp
@@ -98,6 +98,8 @@
* @returns String representation of the ip.
*/
std::string toString(const InAddrAny& addr);
+std::string toString(const struct in_addr& addr);
+std::string toString(const struct in6_addr& addr);
/* @brief converts the prefix into subnetmask.
* @param[in] addressFamily - IP address family(AF_INET/AF_INET6).