Skip to content

fix: skip reserved IPs #2060

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

Merged
merged 2 commits into from
Jul 17, 2023
Merged

Conversation

jaer-tsun
Copy link
Contributor

@jaer-tsun jaer-tsun commented Jul 14, 2023

Reason for Change:

We need to use .1 address of subnet as GW; skipping 0th and last IP of subnets since they are reserved from HNS POV

Issue Fixed:

Requirements:

Notes:

@jaer-tsun jaer-tsun requested a review from a team as a code owner July 14, 2023 21:37
@jaer-tsun jaer-tsun requested a review from csfmomo July 14, 2023 21:37
rbtr
rbtr previously approved these changes Jul 14, 2023
Copy link
Contributor

@rbtr rbtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no objection as a quick fix for Windows but think we should only reserve the subnet's 0th address and broadcast instead of the .0 and .255 out of every /24 within the subnet

@jaer-tsun jaer-tsun force-pushed the tsch/skipReservedIPs branch 3 times, most recently from af70959 to ce76762 Compare July 14, 2023 22:38
@jaer-tsun jaer-tsun force-pushed the tsch/skipReservedIPs branch from ce76762 to 778bace Compare July 17, 2023 15:18
// as secondary IPs
startingAddr := primaryIPPrefix.Masked().Addr() // the masked address is the 0th IP in the subnet
// the masked address is the 0th IP in the subnet and startingAddr is the 2nd IP (*.1)
startingAddr := primaryIPPrefix.Masked().Addr().Next()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to reserve .255

},
}

var validVNETBlockRequest = &cns.CreateNetworkContainerRequest{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please also add a test case for ipv6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll add later since this needs to go in for quick-fix

@jaer-tsun jaer-tsun enabled auto-merge (squash) July 17, 2023 17:40
@@ -35,3 +35,63 @@ var validOverlayRequest = &cns.CreateNetworkContainerRequest{
},
},
}

var validVNETBlockRequest = &cns.CreateNetworkContainerRequest{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you inline these vars in the body of the tests that use them or turn them into factory funcs?

Despite their prevalence in ACN code, using package variables for test data is not a best practice.

@jaer-tsun jaer-tsun merged commit 33890dd into Azure:master Jul 17, 2023
@jaer-tsun jaer-tsun deleted the tsch/skipReservedIPs branch July 17, 2023 20:06
jaer-tsun added a commit to jaer-tsun/azure-container-networking that referenced this pull request Jul 17, 2023
jaer-tsun added a commit to jaer-tsun/azure-container-networking that referenced this pull request Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants