Fix nullability of partitioned route

This commit is contained in:
Davide De Rosa 2020-05-23 17:07:59 +02:00
parent 17cb2601be
commit 7a278dba69
3 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN
- (BOOL)isDefault; - (BOOL)isDefault;
- (BOOL)matchesDestination:(NSString *)destination; - (BOOL)matchesDestination:(NSString *)destination;
- (NSArray<RoutingTableEntry *> *)partitioned; - (nullable NSArray<RoutingTableEntry *> *)partitioned;
@end @end

View File

@ -249,7 +249,7 @@ static NSString *RoutingTableEntryName(struct sockaddr *sa, struct sockaddr *mas
} }
} }
- (NSArray<RoutingTableEntry *> *)partitioned - (nullable NSArray<RoutingTableEntry *> *)partitioned
{ {
NSMutableArray<RoutingTableEntry *> *segments = [[NSMutableArray alloc] init]; NSMutableArray<RoutingTableEntry *> *segments = [[NSMutableArray alloc] init];
const int halfPrefix = (int)(self.prefix + 1); const int halfPrefix = (int)(self.prefix + 1);

View File

@ -741,7 +741,7 @@ extension OpenVPNTunnelProvider: OpenVPNSessionDelegate {
let gateway = table.defaultGateway4()?.gateway(), let gateway = table.defaultGateway4()?.gateway(),
let route = table.broadestRoute4(matchingDestination: gateway) { let route = table.broadestRoute4(matchingDestination: gateway) {
route.partitioned().forEach { route.partitioned()?.forEach {
let destination = $0.network() let destination = $0.network()
guard let netmask = $0.networkMask() else { guard let netmask = $0.networkMask() else {
return return
@ -758,7 +758,7 @@ extension OpenVPNTunnelProvider: OpenVPNSessionDelegate {
let gateway = table.defaultGateway6()?.gateway(), let gateway = table.defaultGateway6()?.gateway(),
let route = table.broadestRoute6(matchingDestination: gateway) { let route = table.broadestRoute6(matchingDestination: gateway) {
route.partitioned().forEach { route.partitioned()?.forEach {
let destination = $0.network() let destination = $0.network()
let prefix = $0.prefix() let prefix = $0.prefix()