Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix end address of ranges built by rangesFromBoundaries() #68

Merged
merged 1 commit into from
May 26, 2021

Conversation

mlocati
Copy link
Owner

@mlocati mlocati commented May 26, 2021

Fix #64.

With this fix, the result of

$ranges = \IPLib\Factory::rangesFromBoundaries('192.168.0.1', '192.168.0.78');
echo sprintf("%-15s %-15s %-15s %-15s\n", 'ip', 'start', 'end', 'realend');
foreach($ranges as $range) {
    $range2 = \IPLib\Range\Subnet::fromString($range . '');
    echo sprintf("%-15s %-15s %-15s %-15s\n", $range, $range->getStartAddress(), $range->getEndAddress(), $range2->getEndAddress());
}

is

ip              start           end             realend        
192.168.0.1/32  192.168.0.1     192.168.0.1     192.168.0.1    
192.168.0.2/31  192.168.0.2     192.168.0.3     192.168.0.3    
192.168.0.4/30  192.168.0.4     192.168.0.7     192.168.0.7    
192.168.0.8/29  192.168.0.8     192.168.0.15    192.168.0.15   
192.168.0.16/28 192.168.0.16    192.168.0.31    192.168.0.31   
192.168.0.32/27 192.168.0.32    192.168.0.63    192.168.0.63   
192.168.0.64/29 192.168.0.64    192.168.0.71    192.168.0.71   
192.168.0.72/30 192.168.0.72    192.168.0.75    192.168.0.75   
192.168.0.76/31 192.168.0.76    192.168.0.77    192.168.0.77   
192.168.0.78/32 192.168.0.78    192.168.0.78    192.168.0.78   

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 98.419% when pulling 3763f50 on fix-rangesFromBoundaries-end-address into a2a3bdf on master.

@mlocati mlocati merged commit 77a1c0d into master May 26, 2021
@mlocati mlocati deleted the fix-rangesFromBoundaries-end-address branch May 26, 2021 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug report] \IPLib\Factory::rangesFromBoundaries() getEndAddress problem
2 participants