]> Git Repo - qemu.git/commit
sockets: don't block IPv4 clients when listening on "::"
authorDaniel P. Berrange <[email protected]>
Wed, 17 May 2017 17:35:40 +0000 (18:35 +0100)
committerDaniel P. Berrange <[email protected]>
Fri, 14 Jul 2017 13:28:29 +0000 (14:28 +0100)
commit4dc5d815c43b0138e5d6753e788343f6e2cb6b5f
tree38a7df99d9629f4a0b68b7a7a6a1fb6369561e95
parent5e059be4c7b75e20c29afb0e03b646864ae93f32
sockets: don't block IPv4 clients when listening on "::"

When inet_parse() parses the hostname, it is forcing the
has_ipv6 && ipv6 flags if the address contains a ":". This
means that if the user had set the ipv4=on flag, to try to
restrict the listener to just ipv4, an error would not have
been raised.  eg

   -incoming tcp:[::]:9000,ipv4

should have raised an error because listening for IPv4
on "::" is a non-sensical combination. With this removed,
we now call getaddrinfo() on "::" passing PF_INET and
so getaddrinfo reports an error about the hostname being
incompatible with the requested protocol:

 qemu-system-x86_64: -incoming tcp:[::]:9000,ipv4: address resolution
    failed for :::9000: Address family for hostname not supported

Likewise it is explicitly setting the has_ipv4 & ipv4
flags when the address contains only digits + '.'. This
has no ill-effect, but also has no benefit, so is removed.

Acked-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Daniel P. Berrange <[email protected]>
util/qemu-sockets.c
This page took 0.026325 seconds and 4 git commands to generate.