Fixed hydration of the Network class with IPv6 addresses#339
Merged
Conversation
Contributor
Author
|
@GrahamCampbell opened PR here. Issue when building the network entity for droplets with IPv6. |
7fb3869 to
8d30f7b
Compare
For IPv6 networks the netmask is integer and the CIDR field is assigned with `int` to a field with `string` constraint. The netmask in this case represents the number for allow networks. The IPv6 address `2b03:b0c0:2:d0::102e:d001` should have the CIDR notation `2b03:b0c0:2:d0::102e:d001/64` or `2b03:b0c0:0002:00d0:0000:0000:0000:0000/64`. I'm not 100% sure what the netmask value can be on the api die, is it always int? or can it come as string? that's why the check for int.
Contributor
Author
|
Added missing test for |
Contributor
Author
|
Refactored the fix to comply with Probably similar |
GrahamCampbell
requested changes
Mar 11, 2025
* Tested multiple solutions, this is the nicest and most minimal one, and probably more correct since we are not manipulating values we iterate on. * This also this resulted some cleanup on the baseline rules file.
Member
|
Thanks for the PR. :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The IPv6 address
2b03:b0c0:2:d0::102e:d001should have the CIDR notation2b03:b0c0:2:d0::102e:d001/64,2b03:b0c0:0002:00d0:0000:0000:0000:0000/64.I'm not 100% sure what the netmask value can be, is it always int? or can it come as string? that's why the check.
I guess this also applies for 4.x versions, it's just that the field not have the constraint there and don't produce this error.