Skip to content
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

Fix "Controller Not Reachable" Error when invalid IP range exists in a network. #419

Merged
merged 2 commits into from
May 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
do not throw error if ip out of range
  • Loading branch information
sinamics committed May 22, 2024
commit ba9f35e29310e43bd2a00c47f919bcbad60295e5
8 changes: 1 addition & 7 deletions src/utils/IPv4gen.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// function randomOctet() {
// return Math.floor(Math.random() * 255);

import { throwError } from "~/server/helpers/errorHandler";

// }
const cidrOptions = [
"10.121.15.0/24",
"10.121.16.0/24",
Expand Down Expand Up @@ -128,7 +122,7 @@ export const getNetworkClassCIDR = (

for (const range of ipRanges) {
if (ipToNumber(range.ipRangeStart) >= ipToNumber(range.ipRangeEnd)) {
return throwError("Invalid IP range provided");
continue;
}

const binaryStart = ipToBinary(range.ipRangeStart);
Expand Down
Loading