mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-02 01:20:54 +00:00
Add a patch that sends a probe packet to the server when setting up the
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
This commit is contained in:
parent
b8f7cc606a
commit
ea0f1337b8
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=455109
@ -3,6 +3,7 @@
|
||||
|
||||
PORTNAME= collectd
|
||||
PORTVERSION= 5.8.0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net-mgmt
|
||||
MASTER_SITES= https://storage.googleapis.com/collectd-tarballs/
|
||||
PKGNAMESUFFIX= 5
|
||||
|
@ -0,0 +1,16 @@
|
||||
--- 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);
|
16
net-mgmt/collectd5/files/patch-src_network.c
Normal file
16
net-mgmt/collectd5/files/patch-src_network.c
Normal file
@ -0,0 +1,16 @@
|
||||
--- src/network.c.orig
|
||||
+++ src/network.c
|
||||
@@ -2000,6 +2000,13 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
+ status = sendto(client->fd, "", 1, 0, ai_ptr->ai_addr, ai_ptr->ai_addrlen);
|
||||
+ if (status != 1) {
|
||||
+ close(client->fd);
|
||||
+ client->fd = -1;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
client->addr = calloc(1, sizeof(*client->addr));
|
||||
if (client->addr == NULL) {
|
||||
ERROR("network plugin: calloc failed.");
|
Loading…
Reference in New Issue
Block a user