From owner-svn-ports-all@freebsd.org Wed Aug 31 14:33:37 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 85071BCAAB8; Wed, 31 Aug 2016 14:33:37 +0000 (UTC) (envelope-from garga@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 3E088197; Wed, 31 Aug 2016 14:33:37 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VEXaW0060143; Wed, 31 Aug 2016 14:33:36 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VEXaF0060141; Wed, 31 Aug 2016 14:33:36 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201608311433.u7VEXaF0060141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Wed, 31 Aug 2016 14:33:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r421168 - in head/net/pear-Net_IPv6: . 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.22 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: Wed, 31 Aug 2016 14:33:37 -0000 Author: garga Date: Wed Aug 31 14:33:36 2016 New Revision: 421168 URL: https://svnweb.freebsd.org/changeset/ports/421168 Log: Fix some bad IPv6 validation issues Following bad addresses are being validated as good by checkIPv6() 1:2:3:4:5:6:7:8:1.2.3.4 ::1:2:3:4:5:6:7:8 1:2:3:4:5:6:7:8:: 1:2:3:4:5:6:::8 ::::a :::: 1::2::3 Obtained from: pfSense MFH: 2016Q3 Sponsored by: Rubicon Communications (Netgate) Added: head/net/pear-Net_IPv6/files/ head/net/pear-Net_IPv6/files/patch-Net_IPv6.php (contents, props changed) Modified: head/net/pear-Net_IPv6/Makefile Modified: head/net/pear-Net_IPv6/Makefile ============================================================================== --- head/net/pear-Net_IPv6/Makefile Wed Aug 31 14:30:13 2016 (r421167) +++ head/net/pear-Net_IPv6/Makefile Wed Aug 31 14:33:36 2016 (r421168) @@ -3,6 +3,7 @@ PORTNAME= Net_IPv6 DISTVERSION= 1.3.0.b2 +PORTREVISION= 1 CATEGORIES= net pear DISTNAME= ${PORTNAME}-1.3.0b2 Added: head/net/pear-Net_IPv6/files/patch-Net_IPv6.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/pear-Net_IPv6/files/patch-Net_IPv6.php Wed Aug 31 14:33:36 2016 (r421168) @@ -0,0 +1,35 @@ +--- Net/IPv6.php.orig 2016-08-31 14:11:53 UTC ++++ Net/IPv6.php +@@ -550,7 +550,7 @@ class Net_IPv6 + + if (false !== strpos($uip, '::') ) { + +- list($ip1, $ip2) = explode('::', $uip); ++ list($ip1, $ip2) = explode('::', $uip, 2); + + if ("" == $ip1) { + +@@ -601,12 +601,12 @@ class Net_IPv6 + + } else if (-1 == $c1) { // ::xxx + +- $fill = str_repeat('0:', 7-$c2); ++ $fill = str_repeat('0:', max(1, 7-$c2)); + $uip = str_replace('::', $fill, $uip); + + } else if (-1 == $c2) { // xxx:: + +- $fill = str_repeat(':0', 7-$c1); ++ $fill = str_repeat(':0', max(1, 7-$c1)); + $uip = str_replace('::', $fill, $uip); + + } else { // xxx::xxx +@@ -912,7 +912,7 @@ class Net_IPv6 + + } + +- if (8 == $count) { ++ if (8 == $count and empty($ipPart[1])) { + + return true; +