mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
rpc: Check and message setsockopt()
Check status when attempting to set SO_REUSEADDR flag on outgoing connection On failure, VIR_WARN(), but continue to connect. This code path is on the sender side where the setting is just a hint and would only take effect if the sender is overflowed with TCP connections. Inability to set doesn't mean failure to establish a connection.
This commit is contained in:
parent
4d4a8aa9ad
commit
d514d7773c
@ -473,7 +473,9 @@ int virNetSocketNewConnectTCP(const char *nodename,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) {
|
||||||
|
VIR_WARN("Unable to enable port reuse");
|
||||||
|
}
|
||||||
|
|
||||||
if (connect(fd, runp->ai_addr, runp->ai_addrlen) >= 0)
|
if (connect(fd, runp->ai_addr, runp->ai_addrlen) >= 0)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user