From 25ab92910301840ddf6fed60ee8010f75f1ad2a1 Mon Sep 17 00:00:00 2001 From: Julien Mulot Date: Sun, 19 Sep 2021 15:33:08 +0200 Subject: [PATCH 1/2] Fix a FLSM bug when submit a CIDR IP Address --- SubnetCalcAppDelegate.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SubnetCalcAppDelegate.swift b/SubnetCalcAppDelegate.swift index 3c1b1a5..3d18828 100644 --- a/SubnetCalcAppDelegate.swift +++ b/SubnetCalcAppDelegate.swift @@ -815,7 +815,7 @@ class SubnetCalcAppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate, } else if (tableView == viewFLSM) { //print("refresh View FLSM") - var ipaddr: UInt32 = ((IPSubnetCalc.numerize(ipAddress: ipsc!.ipv4Address) & ipsc!.classMask()) >> (32 - ipsc!.maskBits)) << (32 - ipsc!.maskBits) + var ipaddr: UInt32 = ((IPSubnetCalc.numerize(ipAddress: ipsc!.ipv4Address) & IPSubnetCalc.numerize(maskbits: ipsc!.maskBits)) >> (32 - ipsc!.maskBits)) << (32 - ipsc!.maskBits) ipaddr = (ipaddr >> (32 - (ipsc!.maskBits + slideFLSM.integerValue)) + UInt32(row)) << (32 - (ipsc!.maskBits + slideFLSM.integerValue)) let ipsc_tmp = IPSubnetCalc(ipAddress: IPSubnetCalc.digitize(ipAddress: ipaddr), maskbits: (ipsc!.maskBits + slideFLSM.integerValue)) if (tableColumn != nil && ipsc_tmp != nil) { @@ -1169,7 +1169,7 @@ class SubnetCalcAppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate, let cvsFile = FileHandle(forWritingAtPath: panel.url!.path) if (cvsFile != nil) { var cvsStr = "#;Subnet ID;Mask bits;Range;Broadcast\n" - let subnetid: UInt32 = ((IPSubnetCalc.numerize(ipAddress: self.ipsc!.ipv4Address) & self.ipsc!.classMask()) >> (32 - self.ipsc!.maskBits)) << (32 - self.ipsc!.maskBits) + let subnetid: UInt32 = ((IPSubnetCalc.numerize(ipAddress: self.ipsc!.ipv4Address) & IPSubnetCalc.numerize(maskbits: self.ipsc!.maskBits)) >> (32 - self.ipsc!.maskBits)) << (32 - self.ipsc!.maskBits) for index in (0...(Int(truncating: NSDecimalNumber(decimal: pow(2, self.slideFLSM.integerValue))) - 1)) { let ipaddr = (subnetid >> (32 - (self.ipsc!.maskBits + self.slideFLSM.integerValue)) + UInt32(index)) << (32 - (self.ipsc!.maskBits + self.slideFLSM.integerValue)) let ipsc_tmp = IPSubnetCalc(ipAddress: IPSubnetCalc.digitize(ipAddress: ipaddr), maskbits: (self.ipsc!.maskBits + self.slideFLSM.integerValue)) From 7e0612e7fb1117ca535dcb714aa4ec124b7ed737 Mon Sep 17 00:00:00 2001 From: Julien Mulot Date: Sun, 19 Sep 2021 18:31:26 +0200 Subject: [PATCH 2/2] Update version and README --- README.md | 7 +++---- SubnetCalc.xcodeproj/project.pbxproj | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 31185b7..35b750f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # SubnetCalc Subnet Calculator for MacOS -What's New in version 2.2: -- Change the VLSM Subnet Name by editing the corresponding column -- Display Hosts Range and Broadcast columns in the VLSM view -- Export Hosts Range and Broadcast infos to the CSV file +What's New in version 2.3: +- FLSM subnet ID bug fix + diff --git a/SubnetCalc.xcodeproj/project.pbxproj b/SubnetCalc.xcodeproj/project.pbxproj index f50e9e9..40b2d6e 100644 --- a/SubnetCalc.xcodeproj/project.pbxproj +++ b/SubnetCalc.xcodeproj/project.pbxproj @@ -401,7 +401,7 @@ CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = VNLK894MAE; ENABLE_HARDENED_RUNTIME = YES; GCC_DYNAMIC_NO_PIC = NO; @@ -411,7 +411,7 @@ INFOPLIST_FILE = "SubnetCalc-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MARKETING_VERSION = 2.2; + MARKETING_VERSION = 2.3; PRODUCT_BUNDLE_IDENTIFIER = net.mulot.subnetcalc; PRODUCT_NAME = SubnetCalc; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -430,7 +430,7 @@ CODE_SIGN_ENTITLEMENTS = SubnetCalc.entitlements; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = VNLK894MAE; ENABLE_HARDENED_RUNTIME = YES; @@ -439,7 +439,7 @@ INFOPLIST_FILE = "SubnetCalc-Info.plist"; INSTALL_PATH = /Applications; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MARKETING_VERSION = 2.2; + MARKETING_VERSION = 2.3; PRODUCT_BUNDLE_IDENTIFIER = net.mulot.subnetcalc; PRODUCT_NAME = SubnetCalc; PROVISIONING_PROFILE_SPECIFIER = "";