Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Nov 2017 13:12:24 +0000 (UTC)
From:      =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= <des@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r455109 - in head/net-mgmt/collectd5: . files
Message-ID:  <201711291312.vATDCOlC087934@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Wed Nov 29 13:12:24 2017
New Revision: 455109
URL: https://svnweb.freebsd.org/changeset/ports/455109

Log:
  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

Added:
  head/net-mgmt/collectd5/files/patch-src_libcollectdclient_network.c   (contents, props changed)
  head/net-mgmt/collectd5/files/patch-src_network.c   (contents, props changed)
Modified:
  head/net-mgmt/collectd5/Makefile

Modified: head/net-mgmt/collectd5/Makefile
==============================================================================
--- head/net-mgmt/collectd5/Makefile	Wed Nov 29 12:53:57 2017	(r455108)
+++ head/net-mgmt/collectd5/Makefile	Wed Nov 29 13:12:24 2017	(r455109)
@@ -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

Added: head/net-mgmt/collectd5/files/patch-src_libcollectdclient_network.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/collectd5/files/patch-src_libcollectdclient_network.c	Wed Nov 29 13:12:24 2017	(r455109)
@@ -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);

Added: head/net-mgmt/collectd5/files/patch-src_network.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/collectd5/files/patch-src_network.c	Wed Nov 29 13:12:24 2017	(r455109)
@@ -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.");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711291312.vATDCOlC087934>