aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2017-11-29 21:12:24 +0800
committerdes <des@FreeBSD.org>2017-11-29 21:12:24 +0800
commit8ceb626af61b5e6bea815bbac173b699e4932a07 (patch)
tree2f4c8ccc3b6781c53253ac06e26d631e75442372 /net-mgmt
parentb511662db1dbc4eda970658cffa3da93e780da2d (diff)
downloadfreebsd-ports-gnome-8ceb626af61b5e6bea815bbac173b699e4932a07.tar.gz
freebsd-ports-gnome-8ceb626af61b5e6bea815bbac173b699e4932a07.tar.zst
freebsd-ports-gnome-8ceb626af61b5e6bea815bbac173b699e4932a07.zip
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
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/collectd5/Makefile1
-rw-r--r--net-mgmt/collectd5/files/patch-src_libcollectdclient_network.c16
-rw-r--r--net-mgmt/collectd5/files/patch-src_network.c16
3 files changed, 33 insertions, 0 deletions
diff --git a/net-mgmt/collectd5/Makefile b/net-mgmt/collectd5/Makefile
index 4e3ad57908ab..48de1377c447 100644
--- a/net-mgmt/collectd5/Makefile
+++ b/net-mgmt/collectd5/Makefile
@@ -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
diff --git a/net-mgmt/collectd5/files/patch-src_libcollectdclient_network.c b/net-mgmt/collectd5/files/patch-src_libcollectdclient_network.c
new file mode 100644
index 000000000000..07f83d94d359
--- /dev/null
+++ b/net-mgmt/collectd5/files/patch-src_libcollectdclient_network.c
@@ -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);
diff --git a/net-mgmt/collectd5/files/patch-src_network.c b/net-mgmt/collectd5/files/patch-src_network.c
new file mode 100644
index 000000000000..7b159123e621
--- /dev/null
+++ b/net-mgmt/collectd5/files/patch-src_network.c
@@ -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.");