mirror of
https://git.freebsd.org/ports.git
synced 2025-07-14 15:59:18 -04:00
client socket. It helps in a few cases where the server has multiple addresses, only some of them are reachable, and connect() succeeds even though sendto() will fail. Approved by: maintainer
16 lines
390 B
C
16 lines
390 B
C
--- src/libcollectdclient/network.c.orig
|
|
+++ src/libcollectdclient/network.c
|
|
@@ -174,6 +174,13 @@
|
|
continue;
|
|
}
|
|
|
|
+ status = sendto(srv->fd, "", 1, 0, ai_ptr->ai_addr, ai_ptr->ai_addrlen);
|
|
+ if (status != 1) {
|
|
+ close(srv->fd);
|
|
+ srv->fd = -1;
|
|
+ continue;
|
|
+ }
|
|
+
|
|
srv->sa = malloc(ai_ptr->ai_addrlen);
|
|
if (srv->sa == NULL) {
|
|
close(srv->fd);
|