From owner-svn-ports-all@freebsd.org Mon Nov 25 13:52:28 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E933E1AD40C; Mon, 25 Nov 2019 13:52:28 +0000 (UTC) (envelope-from dch@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47M7l05ylNz4RZH; Mon, 25 Nov 2019 13:52:28 +0000 (UTC) (envelope-from dch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B174DDAC6; Mon, 25 Nov 2019 13:52:28 +0000 (UTC) (envelope-from dch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPDqSJx064357; Mon, 25 Nov 2019 13:52:28 GMT (envelope-from dch@FreeBSD.org) Received: (from dch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPDqSFK064355; Mon, 25 Nov 2019 13:52:28 GMT (envelope-from dch@FreeBSD.org) Message-Id: <201911251352.xAPDqSFK064355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dch set sender to dch@FreeBSD.org using -f From: Dave Cottlehuber Date: Mon, 25 Nov 2019 13:52:28 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r518407 - in head/net-mgmt/rubygem-riemann-client: . files X-SVN-Group: ports-head X-SVN-Commit-Author: dch X-SVN-Commit-Paths: in head/net-mgmt/rubygem-riemann-client: . files X-SVN-Commit-Revision: 518407 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2019 13:52:29 -0000 Author: dch Date: Mon Nov 25 13:52:28 2019 New Revision: 518407 URL: https://svnweb.freebsd.org/changeset/ports/518407 Log: net-mgmt/rubygem-riemann-client: fix ipv6 Sponsored by: SkunkWerks. GmbH Added: head/net-mgmt/rubygem-riemann-client/files/patch-lib_riemann_client_tcp__socket.rb (contents, props changed) Modified: head/net-mgmt/rubygem-riemann-client/Makefile Modified: head/net-mgmt/rubygem-riemann-client/Makefile ============================================================================== --- head/net-mgmt/rubygem-riemann-client/Makefile Mon Nov 25 13:42:46 2019 (r518406) +++ head/net-mgmt/rubygem-riemann-client/Makefile Mon Nov 25 13:52:28 2019 (r518407) @@ -2,6 +2,7 @@ PORTNAME= riemann-client DISTVERSION= 0.2.6 +PORTREVISION= 1 CATEGORIES= net-mgmt rubygems MASTER_SITES= RG Added: head/net-mgmt/rubygem-riemann-client/files/patch-lib_riemann_client_tcp__socket.rb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/rubygem-riemann-client/files/patch-lib_riemann_client_tcp__socket.rb Mon Nov 25 13:52:28 2019 (r518407) @@ -0,0 +1,48 @@ +--- lib/riemann/client/tcp_socket.rb.orig 2019-11-25 11:01:31 UTC ++++ lib/riemann/client/tcp_socket.rb +@@ -107,13 +107,14 @@ module Riemann + # Using the options from the initializer, a new ::Socket is created that + # is: + # +- # TCP, IPv4 only, autoclosing on exit, nagle's algorithm is disabled and has ++ # TCP, autoclosing on exit, nagle's algorithm is disabled and has + # TCP Keepalive options set if keepalive is supported. + # +- # Returns a new ::Socket instance +- def blank_socket +- sock = ::Socket.new(::Socket::AF_INET, ::Socket::SOCK_STREAM, 0) ++ # Returns a new ::Socket instance for + ++ def socket_factory(type) ++ sock = ::Socket.new(type, ::Socket::SOCK_STREAM, 0) ++ + # close file descriptors if we exec + if Fcntl.constants.include?(:F_SETFD) && Fcntl.constants.include?(:FD_CLOEXEC) + sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) +@@ -167,13 +168,14 @@ module Riemann + # Calculate our timeout deadline + deadline = Time.now.to_f + connect_timeout + +- # Lookup destination address, we only want IPv4 , TCP +- addrs = ::Socket.getaddrinfo(host, port, ::Socket::AF_INET, ::Socket::SOCK_STREAM ) ++ # Lookup destination address, we only want TCP. ++ addrs = ::Socket.getaddrinfo(host, port, nil, ::Socket::SOCK_STREAM ) + errors = [] + conn_error = lambda { raise errors.first } + sock = nil + +- addrs.find( conn_error ) do |addr| ++ # Sort it so we get AF_INET, IPv4 ++ addrs.sort.find( conn_error ) do |addr| + sock = connect_or_error( addr, deadline, errors ) + end + return sock +@@ -210,7 +212,7 @@ module Riemann + # connection was possible. + def connect_nonblock( addr, timeout ) + sockaddr = ::Socket.pack_sockaddr_in(addr[1], addr[3]) +- sock = blank_socket() ++ sock = self.socket_factory( addr[4] ) + sock.connect_nonblock( sockaddr ) + return sock + rescue Errno::EINPROGRESS