On Tue, Dec 22, 2015 at 02:44:00PM +0000, Peter Maydell wrote: > On 17 December 2015 at 13:45, Daniel P. Berrange <berra...@redhat.com> wrote: > > Implement a QIOChannel subclass that supports sockets I/O. > > The implementation is able to manage a single socket file > > descriptor, whether a TCP/UNIX listener, TCP/UNIX connection, > > or a UDP datagram. It provides APIs which can listen and > > connect either asynchronously or synchronously. Since there > > is no asynchronous DNS lookup API available, it uses the > > QIOTask helper for spawning a background thread to ensure > > non-blocking operation. > > (There's GNU adns for async DNS lookups, but I guess we don't > really want the extra dependency.) > > > +static void test_io_channel_ipv4(bool async) > > +{ > > + SocketAddress *listen_addr = g_new0(SocketAddress, 1); > > + SocketAddress *connect_addr = g_new0(SocketAddress, 1); > > + > > + listen_addr->type = SOCKET_ADDRESS_KIND_INET; > > + listen_addr->u.inet = g_new0(InetSocketAddress, 1); > > + listen_addr->u.inet->host = g_strdup("0.0.0.0"); > > + listen_addr->u.inet->port = NULL; /* Auto-select */ > > + > > + connect_addr->type = SOCKET_ADDRESS_KIND_INET; > > + connect_addr->u.inet = g_new0(InetSocketAddress, 1); > > + connect_addr->u.inet->host = g_strdup("127.0.0.1"); > > + connect_addr->u.inet->port = NULL; /* Filled in later */ > > Does this test program really need to create a listening > socket on the host's external interface? Anybody could > connect to it, which means half this test code is suddenly > a security boundary...
Pretty sure we can switch that 0.0.0.0 to also be 127.0.0.1. I'll double check and send a patch if it works. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|