X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Uplink%2FIPAddr.class.php;h=661a8e209ac694230b790a261c92da3c60b3d2e4;hp=e486fb0caa787509382a2721daed3eb5e29dcf26;hb=55c45ccc4c5422ddd9ca3bb8840b5e75aa4184bc;hpb=d366927546c9ab2a52f6f87cf96aa3a4e6fd5cbb diff --git a/Uplink/IPAddr.class.php b/Uplink/IPAddr.class.php index e486fb0..661a8e2 100644 --- a/Uplink/IPAddr.class.php +++ b/Uplink/IPAddr.class.php @@ -34,7 +34,7 @@ class IPAddr { public function __construct($initial_value) { for($i = 0; $i < 8; $i++) { - $ip6[$i] = 0; + $this->ip6[$i] = 0; } if($initial_value == null) { //nothing @@ -67,6 +67,7 @@ class IPAddr { $i += 3; } } + $this->addr_is_ipv6 = true; } } @@ -83,6 +84,7 @@ class IPAddr { $this->ip6[$j++] = hexdec($block); } } + $this->addr_is_ipv6 = true; } public function parseIPv4($ipv4) { @@ -91,6 +93,7 @@ class IPAddr { $this->ip6[6] |= intval($ipv4blocks[1]); $this->ip6[7] = intval($ipv4blocks[2]) << 8; $this->ip6[7] |= intval($ipv4blocks[3]); + $this->addr_is_ipv6 = false; } public function isIPv6() {