]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpc: ensure all sockets bind to same port when service is NULL
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 26 Jun 2019 11:22:29 +0000 (12:22 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 12 Jul 2019 15:55:39 +0000 (16:55 +0100)
commitf8b3905edf6779d65737a4141da7efa3cc731206
tree94901f5be60a6de48d58adc121c79706dac56fa3
parentb632e00ffbfee7b11074bf4ca5f4399e929bbe53
rpc: ensure all sockets bind to same port when service is NULL

When the service passed to getaddrinfo is NULL the kernel will choose a
free port to bind to. In a dual stack though we will get separate
sockets for IPv4 and IPv6 and we need them to bind to the same port
number. Thus once the kerel has auto-selected a port for the first
socket, we must disable auto-select for subsequent IP sockets and force
reuse of the first port.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/rpc/virnetsocket.c