plugins
plugins copied to clipboard
Bug report: bad NextIP of "0.0.0.1"
When I use https://github.com/containernetworking/plugins/blob/7e9ada51e751740541969e1ea5a803cbf45adcf3/pkg/ip/cidr.go#L23-L26 to get next IP of address "0.0.0.1", I got an illegal result [2]
but not an expected one [0,0,0,2]
.
This is because intToIP
does not obey the byte length of IPv4(4)/IPv6(16) when first byte is 0. https://github.com/containernetworking/plugins/blob/7e9ada51e751740541969e1ea5a803cbf45adcf3/pkg/ip/cidr.go#L51-L53
This bug will happen when first byte is 0 no matter family is IPv4 or IPv6.