Renamed virNetDevSetIPv4Address as it also handles IPv6 addresses.
---
src/libvirt_private.syms | 2 +-
src/lxc/lxc_container.c | 2 +-
src/network/bridge_driver.c | 4 ++--
src/util/virnetdev.c | 14 +++++++-------
src/util/virnetdev.h | 6 +++---
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index f96387f..72f84e4 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1621,7 +1621,7 @@ virNetDevRxFilterFree;
virNetDevRxFilterModeTypeFromString;
virNetDevRxFilterModeTypeToString;
virNetDevRxFilterNew;
-virNetDevSetIPv4Address;
+virNetDevSetIPAddress;
virNetDevSetMAC;
virNetDevSetMTU;
virNetDevSetMTUFromDevice;
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 4378b3d..783243d 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -560,7 +560,7 @@ static int lxcContainerRenameAndEnableInterfaces(virDomainDefPtr
vmDef,
VIR_DEBUG("Adding IP address '%s/%u' to '%s'",
ip->address, ip->prefix, newname);
- if (virNetDevSetIPv4Address(newname, &address, prefix) < 0) {
+ if (virNetDevSetIPAddress(newname, &address, prefix) < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
_("Failed to set IP address '%s' on
%s"),
ip->address, newname);
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 5f2e778..aa77e13 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1902,8 +1902,8 @@ networkAddAddrToBridge(virNetworkObjPtr network,
return -1;
}
- if (virNetDevSetIPv4Address(network->def->bridge,
- &ipdef->address, prefix) < 0)
+ if (virNetDevSetIPAddress(network->def->bridge,
+ &ipdef->address, prefix) < 0)
return -1;
return 0;
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index e4a005a..771f11c 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -870,7 +870,7 @@ static struct nl_msg
}
/**
- * virNetDevSetIPv4Address:
+ * virNetDevSetIPAddress:
* @ifname: the interface name
* @addr: the IP address (IPv4 or IPv6)
* @prefix: number of 1 bits in the netmask
@@ -881,9 +881,9 @@ static struct nl_msg
*
* Returns 0 in case of success or -1 in case of error.
*/
-int virNetDevSetIPv4Address(const char *ifname,
- virSocketAddr *addr,
- unsigned int prefix)
+int virNetDevSetIPAddress(const char *ifname,
+ virSocketAddr *addr,
+ unsigned int prefix)
{
virSocketAddr *broadcast = NULL;
int ret = -1;
@@ -928,9 +928,9 @@ int virNetDevSetIPv4Address(const char *ifname,
#else /* defined(__linux__) && defined(HAVE_LIBNL) */
-int virNetDevSetIPv4Address(const char *ifname,
- virSocketAddr *addr,
- unsigned int prefix)
+int virNetDevSetIPAddress(const char *ifname,
+ virSocketAddr *addr,
+ unsigned int prefix)
{
virCommandPtr cmd = NULL;
char *addrstr = NULL, *bcaststr = NULL;
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 2a6e67d..e1087a4 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -87,9 +87,9 @@ int virNetDevIsOnline(const char *ifname,
bool *online)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-int virNetDevSetIPv4Address(const char *ifname,
- virSocketAddr *addr,
- unsigned int prefix)
+int virNetDevSetIPAddress(const char *ifname,
+ virSocketAddr *addr,
+ unsigned int prefix)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
int virNetDevAddRoute(const char *ifname,
virSocketAddrPtr addr,
--
1.8.4.5