IP ranges do not round trip correctly as strings
See original GitHub issueWe are seeing this:
const cidr = "1.2.3.4/5";
IPv4CidrRange.fromCidr(cidr).toCidrString();
// -> 0.0.0.0/5
The CIDR we put in (“1.2.3.4/5”) is not the CIDR we get out (“0.0.0.0/5”)
I can see roughly why this is happening, as /5
is a very big range.
The problem for us is that 1.2.3.4/5
is used as an internal placeholder in CDK: https://github.com/aws/aws-cdk/blob/cea1039e3664fdfa89c6f00cdaeb1a0185a12678/packages/%40aws-cdk/aws-ec2/lib/vpc.ts#L2198
We are seeing tests break when we render our templates and try and round trip things.
What would “you expect to happen” if you put string into a CIDR, then call toCidrString
on it? I would say it should be the same, but I am sure there are some optimisations going on internally that are causing this.
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Program to generate all possible valid IP addresses from ...
Generate all the possible combinations using looping through the string. If IP is found to be valid then return the IP address, ...
Read more >How to sort IP addresses stored in dictionary in Python?
You can use a custom key function to return a sortable representation of your strings: def split_ip(ip): """Split a IP address given as...
Read more >Learn IP Address Concepts With Python's ipaddress Module
In this step-by-step tutorial, you'll learn how to inspect and manipulate IP addresses as Python objects with Python's ipaddress module, improving your ...
Read more >TCP/IP and NBT configuration parameters for Windows XP
The base timeout value is dynamically determined by the measured round-trip time on the connection. TcpNumConnections. Key: Tcpip\Parameters ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should now be fixed in v1.5.0
Terrific thank you. Thanks for this package, it’s very useful!