]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virNetSocketCheckProtocols: Confirm IPv4 by lookup too
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Jul 2020 11:48:46 +0000 (13:48 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 16 Jul 2020 10:19:31 +0000 (12:19 +0200)
commit8b0cb0e666f9fc24e13fe2480663c1688dd6a411
treeddeda4566645481ae9e6acdc0e9ecd78a267e57a
parent9536379da4c8ed6122851e0ed5a2e867ca21d886
virNetSocketCheckProtocols: Confirm IPv4 by lookup too

Historically, if we found an interface with an IPv6 address we
did not blindly trust that host is IPv6 capable (as in we can
successfully translate IPv4 addresses) but used getaddrinfo() to
confirm it. Turns out, we have use the same argument for IPv4.
For instance, in an namespace created by the following steps,
getaddrinfo("127.0.0.1", ...) fails (demonstrating by "Socket
TCP/IPv4 Accept" test case failing in virnetsockettest):

  unshare -n
  ip link set lo up
  ip link add dummy0 type dummy
  ip link set dummy0 up

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/rpc/virnetsocket.c