mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-01-31 05:25:09 +00:00
Fix for Nim devel discrimination checks.
This commit is contained in:
parent
738a9e7b72
commit
38dd4cb6e7
@ -98,10 +98,10 @@ proc init*(t: typedesc[IpMask], family: AddressFamily, prefix: int): IpMask =
|
||||
proc init*(t: typedesc[IpMask], netmask: TransportAddress): IpMask =
|
||||
## Initialize network mask using address ``netmask``.
|
||||
if netmask.family == AddressFamily.IPv4:
|
||||
result.family = netmask.family
|
||||
result = IpMask(family: netmask.family)
|
||||
result.mask4 = cast[ptr uint32](unsafeAddr netmask.address_v4[0])[]
|
||||
elif netmask.family == AddressFamily.IPv6:
|
||||
result.family = netmask.family
|
||||
result = IpMask(family: netmask.family)
|
||||
result.mask6[0] = cast[ptr uint64](unsafeAddr netmask.address_v6[0])[]
|
||||
result.mask6[1] = cast[ptr uint64](unsafeAddr netmask.address_v6[8])[]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user