Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
IPv4 rotation is currently broken. When the route planner tries to find a new Ip it would always pass in a 0 to the
getAddressAtIndex
on the ipblock. This would always return an exception (it checks if the index is 0 or lower and throws)Solution
Remove the code in the route planner that subtracts one from the block index. This fix works for me currently using either 1 large ipv4 block, or a list of ipv4 /32 blocks. I cannot test this fix on any of the ipv6 rotation stuff.
As I am not too familiar with the code base, would this fix be better to implement on the rotator level or within the IP block? I currently changed it within the rotator as that is how my current custom implementation does it and I am not sure if changing it on the IP block level would possibly introduce some regressions.
I am happy to change this fix based on any comments/suggestions.