[libvirt] [PATCH 5/5] guestfwd: Ensure guestfwd address is IPv4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* src/conf/domain_conf.c: Throw an error if guestfwd address isn't IPv4
---
 src/conf/domain_conf.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 94bce1e..ec2a1bc 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1482,6 +1482,13 @@ virDomainChrDefParseXML(virConnectPtr conn,
                         goto error;
                     }
 
+                    if(def->target.addr->stor.ss_family != AF_INET) {
+                        virDomainReportError(conn, VIR_ERR_NO_SUPPORT, "%s",
+                                             _("guestfwd channel only supports "
+                                               "IPv4 addresses"));
+                        goto error;
+                    }
+
                     if(portStr == NULL) {
                         virDomainReportError(conn, VIR_ERR_INVALID_DOMAIN, "%s",
                                              _("guestfwd channel does "
-- 
1.6.2.5

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]