Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.5

Bug #7092 calculate function not working correctly
Submitted: 2006-03-10 19:06 UTC
From: brandon at homeisp dot com Assigned: fa
Status: Wont fix Package: Net_IPv4
PHP Version: 4.3.11 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2006-03-10 19:06 UTC] brandon at homeisp dot com (Brandon Petty)
Description: ------------ When calculating multiple broadcast and network address, the subnet does not change. I have also had quite a few other problems with calculate not giving the correct answers... but for now I will assume it is all related. thanks Test script: --------------- $ip_calc->ip = "1.1.1.60"; $ip_calc->netmask = "255.255.255.192"; $error = $ip_calc->calculate(); //echo "$error"; if(!is_object($error)) { echo "<br>IP: $ip_calc->ip & Sub: $ip_calc->netmask & network: $ip_calc->network & broadcast: $ip_calc->broadcast<br>"; } $ip_calc->ip = "1.1.1.250"; $ip_calc->netmask = "255.255.255.252"; $error = $ip_calc->calculate(); //echo "$error"; if(!is_object($error)) { echo "<br>IP: $ip_calc->ip & Sub: $ip_calc->netmask & network: $ip_calc->network & broadcast: $ip_calc->broadcast<br>"; } $ip_calc->ip = "1.1.1.80"; $ip_calc->netmask = "255.255.255.32"; $error = $ip_calc->calculate(); //echo "$error"; if(!is_object($error)) { echo "<br>IP: $ip_calc->ip & Sub: $ip_calc->netmask & network: $ip_calc->network & broadcast: $ip_calc->broadcast<br>"; } Expected result: ---------------- IP: 1.1.1.60 & Sub: 255.255.255.192 & network: 1.1.1.0 & broadcast: 1.1.1.63 IP: 1.1.1.250 & Sub: 255.255.255.252 & network: 1.1.1.248 & broadcast: 1.1.1.251 IP: 1.1.1.80 & Sub: 255.255.255.32 & network: NOT 1.1.1.64 & broadcast: NOT 1.1.1.127 Actual result: -------------- IP: 1.1.1.60 & Sub: 255.255.255.192 & network: 1.1.1.0 & broadcast: 1.1.1.63 IP: 1.1.1.250 & Sub: 255.255.255.192 & network: 1.1.1.192 & broadcast: 1.1.1.255 IP: 1.1.1.80 & Sub: 255.255.255.192 & network: 1.1.1.64 & broadcast: 1.1.1.127

Comments

 [2006-04-03 10:48 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-04-03 12:06 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!