We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06092f1 commit 588f164Copy full SHA for 588f164
1 file changed
swift/plugin/Sources/Defguard/IpAddrMask.swift
@@ -15,17 +15,20 @@ struct IpAddrMask: Codable, Equatable {
15
separator: "/",
16
maxSplits: 1,
17
)
18
+ let default_cidr: UInt8
19
if let ipv4 = IPv4Address(String(parts[0])) {
20
address = ipv4
21
+ default_cidr = 32
22
} else if let ipv6 = IPv6Address(String(parts[0])) {
23
address = ipv6
24
+ default_cidr = 128
25
} else {
26
return nil
27
}
28
if parts.count > 1 {
29
cidr = UInt8(parts[1]) ?? 0
30
- cidr = 0
31
+ cidr = default_cidr
32
33
34
0 commit comments