This commit is contained in:
Christian Ulrich 2020-07-25 12:00:45 +02:00
parent 73a22c0816
commit f23093fd69
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ proc isPrivateIp(ip: IpAddress): bool =
proc isInNetwork(ip: IpAddress, iface: NetworkInterface): bool = proc isInNetwork(ip: IpAddress, iface: NetworkInterface): bool =
let ipScalar = htonl(cast[uint32](ip.address_v4)) let ipScalar = htonl(cast[uint32](ip.address_v4))
let ifaceIpScalar = htonl(cast[uint32](iface.ipAddress.address_v4)) let ifaceIpScalar = htonl(cast[uint32](iface.ipAddress.address_v4))
let netmaskScalar = htonl(cast[uint32](iface.netmask.address_v4)) let netmaskScalar = htonl(cast[uint32](iface.netMask.address_v4))
(ipScalar and netmaskScalar) == (ifaceIpScalar and netmaskScalar) (ipScalar and netmaskScalar) == (ifaceIpScalar and netmaskScalar)
proc probePublicIp(): Future[IpAddress] {.async.} = proc probePublicIp(): Future[IpAddress] {.async.} =