diff --git a/TunnelKit/Sources/Core/RoutingTableEntry.h b/TunnelKit/Sources/Core/RoutingTableEntry.h index 2a30754..8c6910f 100644 --- a/TunnelKit/Sources/Core/RoutingTableEntry.h +++ b/TunnelKit/Sources/Core/RoutingTableEntry.h @@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)isDefault; - (BOOL)matchesDestination:(NSString *)destination; -- (NSArray *)partitioned; +- (nullable NSArray *)partitioned; @end diff --git a/TunnelKit/Sources/Core/RoutingTableEntry.m b/TunnelKit/Sources/Core/RoutingTableEntry.m index febe7e2..211889f 100644 --- a/TunnelKit/Sources/Core/RoutingTableEntry.m +++ b/TunnelKit/Sources/Core/RoutingTableEntry.m @@ -249,7 +249,7 @@ static NSString *RoutingTableEntryName(struct sockaddr *sa, struct sockaddr *mas } } -- (NSArray *)partitioned +- (nullable NSArray *)partitioned { NSMutableArray *segments = [[NSMutableArray alloc] init]; const int halfPrefix = (int)(self.prefix + 1); diff --git a/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift b/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift index 0c46660..43e6606 100644 --- a/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift +++ b/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift @@ -741,7 +741,7 @@ extension OpenVPNTunnelProvider: OpenVPNSessionDelegate { let gateway = table.defaultGateway4()?.gateway(), let route = table.broadestRoute4(matchingDestination: gateway) { - route.partitioned().forEach { + route.partitioned()?.forEach { let destination = $0.network() guard let netmask = $0.networkMask() else { return @@ -758,7 +758,7 @@ extension OpenVPNTunnelProvider: OpenVPNSessionDelegate { let gateway = table.defaultGateway6()?.gateway(), let route = table.broadestRoute6(matchingDestination: gateway) { - route.partitioned().forEach { + route.partitioned()?.forEach { let destination = $0.network() let prefix = $0.prefix()