qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL v1 4/9] io: add QIOChannelSocket class
Date: Tue, 22 Dec 2015 14:51:00 +0000	[thread overview]
Message-ID: <20151222145059.GD10082@redhat.com> (raw)
In-Reply-To: <CAFEAcA_PzQpoTMPSymENowz7vRb0cch2+xpAph52uT3zLMZRvw@mail.gmail.com>

On Tue, Dec 22, 2015 at 02:44:00PM +0000, Peter Maydell wrote:
> On 17 December 2015 at 13:45, Daniel P. Berrange <berrange@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 :|

  reply	other threads:[~2015-12-22 14:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 13:45 [Qemu-devel] [PULL v1 0/9] Introduce I/O channels framework Daniel P. Berrange
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 1/9] io: add abstract QIOChannel classes Daniel P. Berrange
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 2/9] io: add helper module for creating watches on FDs Daniel P. Berrange
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 3/9] io: add QIOTask class for async operations Daniel P. Berrange
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 4/9] io: add QIOChannelSocket class Daniel P. Berrange
2015-12-22 14:44   ` Peter Maydell
2015-12-22 14:51     ` Daniel P. Berrange [this message]
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 5/9] io: add QIOChannelFile class Daniel P. Berrange
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 6/9] io: add QIOChannelTLS class Daniel P. Berrange
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 7/9] io: add QIOChannelWebsock class Daniel P. Berrange
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 8/9] io: add QIOChannelCommand class Daniel P. Berrange
2015-12-17 13:45 ` [Qemu-devel] [PULL v1 9/9] io: add QIOChannelBuffer class Daniel P. Berrange
2015-12-17 15:04 ` [Qemu-devel] [PULL v1 0/9] Introduce I/O channels framework Peter Maydell
2015-12-17 15:30   ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151222145059.GD10082@redhat.com \
    --to=berrange@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).