-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add a new wrapper for point2point
IPAM that filters invalid addresses and routes
#1647
Add a new wrapper for point2point
IPAM that filters invalid addresses and routes
#1647
Conversation
Signed-off-by: NikitaSkrynnik <[email protected]>
b8326a6
to
4e47f53
Compare
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
ipam
doesn't check if addresses are already allocated
ipam
doesn't check if addresses are already allocatedpoint2point
IPAM doesn't check if addresses are already allocated
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1647 +/- ##
=======================================
Coverage ? 67.94%
=======================================
Files ? 265
Lines ? 12677
Branches ? 0
=======================================
Hits ? 8614
Misses ? 3531
Partials ? 532 ☔ View full report in Codecov by Sentry. |
Signed-off-by: NikitaSkrynnik <[email protected]>
eae7bc0
to
a097588
Compare
Signed-off-by: NikitaSkrynnik <[email protected]>
point2point
IPAM doesn't check if addresses are already allocatedpoint2point
IPAM doesn't check if addresses are already allocated
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
point2point
IPAM doesn't check if addresses are already allocatedpoint2point
IPAM that filters invalid addresses and routes
Signed-off-by: NikitaSkrynnik <[email protected]>
4025b29
to
052572f
Compare
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
if newIPAMServer == nil { | ||
panic("newIPAMServer should not be nil") | ||
} | ||
ipPool := ippool.New(net.IPv6len) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: consider using dualstack ippool
"github.com/networkservicemesh/sdk/pkg/tools/ippool" | ||
) | ||
|
||
type filterIPAMServer struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider better naming. For example primaryipam
.
} | ||
|
||
func (s *filterIPAMServer) getInvalidAddrs(addrs []string) []string { | ||
invalidAddrs := make([]string, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalidAddrs := make([]string, 0) | |
invalidAddrs := []string(nil) |
for _, addr := range ipContext.SrcIpAddrs { | ||
_, ipNet, err := net.ParseCIDR(addr) | ||
if err != nil { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't expect any error here, but don't we want to free the rest?
The same functionality has been implemented in this PR: #1679 |
Description
If
point2point
IPAM receives a request with filledip_context
it doesn't check if some ofip_context
's addresses are already allocated for other connections. The PR adds a new wrapper forpoint2point
IPAM that filters already allocated addresses.Issue link
networkservicemesh/deployments-k8s#11787
How Has This Been Tested?
Types of changes