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

Resize subnet is broken on subnets not on the larger bit boundary #34

Closed
abeeson opened this issue Aug 10, 2015 · 1 comment
Closed

Comments

@abeeson
Copy link
Contributor

abeeson commented Aug 10, 2015

When you resize a subnet, if the smaller subnet being resized up puts it off the bit boundary, PHPIPAM will accept it, and present a subnet that is impossible to actually have.

An example, 10.0.4.0/22 is a valid subnet, having 10.0.4.0 -> 10.0.7.255

If you want to resize that into a larger range (in this case 10.0.0.0/21) and you attempt to resize 10.0.4.0/22, it creates 10.0.4.0/21 but thinks it has 10.0.4.0 -> 10.0.11.255 rather than automatically becoming 10.0.0.0/21, becoming an illegal subnet that crosses the boundary.

The IP calculator is aware of bit boundary and knows what the network should be if you put the old network and new CIDR mask in and it should be easy enough to put a check to put the new sized subnet through to pull the new network for it, then use that for the subnet. This would however break downsizing back, but i think thats fair enough to ensure strict subnet adherance.

@phpipam
Copy link
Owner

phpipam commented Sep 12, 2015

Hi, thanks for reporting, fixed in latest revision.

@phpipam phpipam closed this as completed Sep 12, 2015
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

No branches or pull requests

2 participants