]> Git Repo - qemu.git/commit - io/dns-resolver.c
io: preserve ipv4/ipv6 flags when resolving InetSocketAddress
authorDaniel P. Berrange <[email protected]>
Wed, 17 May 2017 13:34:36 +0000 (14:34 +0100)
committerDaniel P. Berrange <[email protected]>
Fri, 14 Jul 2017 13:28:29 +0000 (14:28 +0100)
commit563a3987b980a36e6941720a99d5cf36960f78ea
tree2a116f41f2982fdcba24cce7509650ebe93cbd35
parent94bc0d19789b6f5ce881c4a06a3e1c431874cbbd
io: preserve ipv4/ipv6 flags when resolving InetSocketAddress

The original InetSocketAddress struct may have has_ipv4 and
has_ipv6 fields set, which will control both the ai_family
used during DNS resolution, and later use of the V6ONLY
flag.

Currently the standalone DNS resolver code drops the
has_ipv4 & has_ipv6 flags after resolving, which means
the later bind() code won't correctly set V6ONLY.

This fixes the following scenarios

  -vnc :0,ipv4=off
  -vnc :0,ipv6=on
  -vnc :::0,ipv4=off
  -vnc :::0,ipv6=on

which all mistakenly accepted IPv4 clients

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]>
io/dns-resolver.c
This page took 0.024081 seconds and 4 git commands to generate.