From owner-svn-ports-all@freebsd.org Tue Nov 22 18:43:10 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCE58C4FAEB; Tue, 22 Nov 2016 18:43:10 +0000 (UTC) (envelope-from sunpoet@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 mx1.freebsd.org (Postfix) with ESMTPS id 81A701CEF; Tue, 22 Nov 2016 18:43:10 +0000 (UTC) (envelope-from sunpoet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAMIh9pP085320; Tue, 22 Nov 2016 18:43:09 GMT (envelope-from sunpoet@FreeBSD.org) Received: (from sunpoet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAMIh9XB085319; Tue, 22 Nov 2016 18:43:09 GMT (envelope-from sunpoet@FreeBSD.org) Message-Id: <201611221843.uAMIh9XB085319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sunpoet set sender to sunpoet@FreeBSD.org using -f From: Sunpoet Po-Chuan Hsieh Date: Tue, 22 Nov 2016 18:43:09 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r426848 - head/net/mtr/files X-SVN-Group: ports-head 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.23 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: Tue, 22 Nov 2016 18:43:10 -0000 Author: sunpoet Date: Tue Nov 22 18:43:09 2016 New Revision: 426848 URL: https://svnweb.freebsd.org/changeset/ports/426848 Log: - Fix build with IPV6 disabled Obtained from: https://github.com/traviscross/mtr/commit/3d1352ca93efca2f8c4be7ccd16cbe2472b4fff0 PR: 214731 [1] Submitted by: [1], Iain Grant (via email) Added: head/net/mtr/files/ head/net/mtr/files/patch-net.c (contents, props changed) Added: head/net/mtr/files/patch-net.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/mtr/files/patch-net.c Tue Nov 22 18:43:09 2016 (r426848) @@ -0,0 +1,66 @@ +--- net.c.orig 2016-08-01 13:07:58 UTC ++++ net.c +@@ -320,9 +320,11 @@ void net_send_tcp(int index) + struct sockaddr_storage local; + struct sockaddr_storage remote; + struct sockaddr_in *local4 = (struct sockaddr_in *) &local; +- struct sockaddr_in6 *local6 = (struct sockaddr_in6 *) &local; + struct sockaddr_in *remote4 = (struct sockaddr_in *) &remote; ++#ifdef ENABLE_IPV6 ++ struct sockaddr_in6 *local6 = (struct sockaddr_in6 *) &local; + struct sockaddr_in6 *remote6 = (struct sockaddr_in6 *) &remote; ++#endif + socklen_t len; + + ttl = index + 1; +@@ -437,9 +439,11 @@ void net_send_sctp(int index) + struct sockaddr_storage local; + struct sockaddr_storage remote; + struct sockaddr_in *local4 = (struct sockaddr_in *) &local; +- struct sockaddr_in6 *local6 = (struct sockaddr_in6 *) &local; + struct sockaddr_in *remote4 = (struct sockaddr_in *) &remote; ++#ifdef ENABLE_IPV6 ++ struct sockaddr_in6 *local6 = (struct sockaddr_in6 *) &local; + struct sockaddr_in6 *remote6 = (struct sockaddr_in6 *) &remote; ++#endif + socklen_t len; + + ttl = index + 1; +@@ -726,8 +730,12 @@ void net_send_query(int index) + + /* sendto() assumes packet length includes the IPv4 header but not the + IPv6 header. */ +- spacketsize = abs(packetsize) - +- ( ( af == AF_INET ) ? 0 : sizeof (struct ip6_hdr) ); ++ spacketsize = abs(packetsize) ++#ifdef ENABLE_IPV6 ++ - ( ( af == AF_INET ) ? 0 : sizeof (struct ip6_hdr) ) ++#endif ++ ; ++ + rv = sendto(sendsock, packet, spacketsize, 0, remotesockaddr, salen); + if (first && (rv < 0) && ((errno == EINVAL) || (errno == EMSGSIZE))) { + /* Try the first packet again using host byte order. */ +@@ -1529,17 +1537,17 @@ void net_reset(void) + + int net_set_interfaceaddress_udp() + { ++ struct sockaddr_in * sa4; ++ struct sockaddr_storage remote; ++ struct sockaddr_in *remote4 = (struct sockaddr_in *) &remote; + #ifdef ENABLE_IPV6 + struct sockaddr_storage name_struct; ++ struct sockaddr_in6 * sa6; ++ struct sockaddr_in6 *remote6 = (struct sockaddr_in6 *) &remote; + #else + struct sockaddr_in name_struct; + #endif +- struct sockaddr_in * sa4; +- struct sockaddr_in6 * sa6; + struct sockaddr * name = (struct sockaddr *) &name_struct; +- struct sockaddr_storage remote; +- struct sockaddr_in *remote4 = (struct sockaddr_in *) &remote; +- struct sockaddr_in6 *remote6 = (struct sockaddr_in6 *) &remote; + socklen_t len; + int s; +