com web/master: Quick fix to only fetch recorded IPv4's, and to note that it will work for IPv4 and IPv4-mapped IPv6.: fetch/mirrors.php
| From: | Daniel P. Brown | Date: | Wed, 10 Oct 2012 20:28:29 +0000 |
| Subject: | com web/master: Quick fix to only fetch recorded IPv4's, and to note that it will work for IPv4 and IPv4-mapped IPv6.: fetch/mirrors.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-14828@lists.php.net to get a copy of this message | ||
Commit: 96092a7c913f1901cb207d9d8bcb73f7ae10c1f1
Author: Daniel P. Brown <danbrown@php.net> Wed, 10 Oct 2012 16:28:29 -0400
Parents: 3745009680fde415ea63f2f104650616b1d3c3f2
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=96092a7c913f1901cb207d9d8bcb73f7ae10c1f1
Log:
Quick fix to only fetch recorded IPv4's, and to note that it will work for IPv4 and IPv4-mapped
IPv6.
Changed paths:
M fetch/mirrors.php
Diff:
diff --git a/fetch/mirrors.php b/fetch/mirrors.php
index 4946e61..933ec74 100644
--- a/fetch/mirrors.php
+++ b/fetch/mirrors.php
@@ -95,12 +95,16 @@ if (@mysql_connect("localhost","nobody","")) {
" \"$row[providerurl]\", $row[mirrortype],
$row[has_search],\n" .
" \"$row[lang]\", $status),\n";
- // Do the same with the IPv4 address as the hostname, for round-robin CC base hosts
- echo ' "'.$row['ipv4_addr'].'" =>
array('.PHP_EOL ..
- ' "'.$row['cc'].'",
"'.$row['providername'].'",
'.$row['has_stats'].','.PHP_EOL .
- ' "'..$row['providerurl'].'",
'.$row['mirrortype'].',
'.$row['has_search'].','.PHP_EOL .
- ' "'.$row['lang'].'",
'.$status.'),'.PHP_EOL;
-
+ // Do the same with the IPv4 address as the hostname, for
+ // round-robin CC base hosts - if the IPv4 is available.
+ // Note that this will also accept IPv4-mapped IPv6
+ // addresses like so: 123:4:56:789::abc:def:127.0.0.1
+ if (strlen($row['ipv4_addr']) >= 15) {
+ echo ' "'.$row['ipv4_addr'].'" =>
array('.PHP_EOL ..
+ ' "'.$row['cc'].'",
"'.$row['providername'].'",
'.$row['has_stats'].','.PHP_EOL .
+ ' "'.$row['providerurl'].'",
'.$row['mirrortype'].',
'.$row['has_search'].','.PHP_EOL .
+ ' "'.$row['lang'].'",
'..$status.'),'.PHP_EOL;
+ }
}
echo ");\n";
}