Bug 832121 - Treat ::0 as a wildcard address
Summary: Treat ::0 as a wildcard address
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-viewer
Version: 6.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: beta
: 6.4
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2012-06-14 15:01 UTC by David Jaša
Modified: 2016-04-26 15:01 UTC (History)
10 users (show)

Fixed In Version: virt-viewer-0.5.2-12.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-02-21 09:33:18 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0361 0 normal SHIPPED_LIVE virt-viewer bug fix and enhancement update 2013-02-20 20:53:07 UTC

Description David Jaša 2012-06-14 15:01:13 UTC
Description of problem:
when connecting to remote libvirt-managed spice display that listens on ::0, virt-viewer doesn't treat it as a wildcard and tries to connect to it, leading to ultimate connection failure.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. have libvirt that listens for remote tcp or tls connections
2. start a VM that will listen on ::0
    <graphics type='spice'>
      <listen type='address' address=''/>
3. connect to the VM from remote machine
virt-viewer -c qemu+(tcp|tls)://ipv4_or_ipv6_address/system VM_NAME
Actual results:
virt-viewer will fail to connect with message that connection to ::0:PORT failed

Expected results:
virt-viewer connects to the VM

Additional info:
* doesn't occur on localhost
* you can also use host's ipv4 address in libvirt URI
* ::0 means by default that the program listens on both ipv4 and ipv6 so sticking the host address given in libvirt URI seem most sensible of possible addresses
* I used ipv4 address in libvirt URI in both cases (qemu+tcp://
* proposing as zstream as this can affect customers in dual-stack environments

--debug output with listen="::0"

** (virt-viewer:3864): DEBUG: Guest graphics address is ::0:3000
** (virt-viewer:3864): DEBUG: Set connect info:,::0,3000,-1,tcp,(null),(null),0
** (virt-viewer:3864): DEBUG: Error operation virDomainOpenGraphics forbidden for read only access
** (virt-viewer:3864): DEBUG: After open connection callback fd=-1
** (virt-viewer:3864): DEBUG: Opening direct TCP connection to display at ::0:3000:-1

--debug output with listen=""

** (virt-viewer:3945): DEBUG: Guest graphics address is
** (virt-viewer:3945): DEBUG: Guest graphics listen '' is NULL or a wildcard, replacing with ''
** (virt-viewer:3945): DEBUG: Set connect info:,,3000,-1,tcp,(null),(null),0
** (virt-viewer:3945): DEBUG: Error operation virDomainOpenGraphics forbidden for read only access
** (virt-viewer:3945): DEBUG: After open connection callback fd=-1
** (virt-viewer:3945): DEBUG: Opening direct TCP connection to display at

Comment 1 David Jaša 2012-06-14 15:02:33 UTC
the graphics elements in steps to reproduce should look like this of course:
    <graphics type='spice'>
      <listen type='address' address='::0'/>

Comment 2 Daniel Berrangé 2012-06-14 15:08:29 UTC
Hmm, we are already doing that:

    /* If the XML listen attribute shows a wildcard address, we need to
     * throw that away since you obviously can't 'connect(2)' to that
     * from a remote host. Instead we fallback to the hostname used in
     * the libvirt URI. This isn't perfect but it is better than nothing
    if (!ghost ||
        (strcmp(ghost, "") == 0 ||
         strcmp(ghost, "::") == 0)) {
        DEBUG_LOG("Guest graphics listen '%s' is NULL or a wildcard, replacing with '%s'",
                  ghost ? ghost : "", host);
        ghost = g_strdup(host);

But it seems like "::" is not the only string format a IPv6 wildcard can take. Basically any combination of exclusively ':' and 0' is a wildcard eg


and so on

Comment 3 RHEL Program Management 2012-07-10 06:58:24 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 RHEL Program Management 2012-07-11 02:02:05 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 7 Geyang Kong 2012-10-15 07:22:38 UTC
Verified pass on the following build:

Reproduce steps:
1. Have a host with ipv6 address
2. Have a running guest.
3. Edit the guest xml, make sure the graphic device is listening to ::, 0::, and so on.
4. Run remote-viewer spice(or vnc)://[ipv6 address]:port

1. Connect to guest successfully.

So mark as this bug as VERIFIED.

Comment 9 errata-xmlrpc 2013-02-21 09:33:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.