Skip to content

Commit

Permalink
fixing toIpAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
elcritch committed Aug 27, 2024
1 parent 3bd5d94 commit d47c050
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/nesper/net_utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ proc toIpAddress*(address: uint32): IpAddress =

proc toIpAddress*(address: array[4, uint32]): IpAddress =
result = IpAddress(family: IpAddressFamily.IPv6)
for i in 0..3:
let subaddr = address[i]
echo "SUBADDR: ", subaddr.repr
for j in 0..3:
result.address_v6[i*4+j] = uint8(subaddr shr (j*8))
copyMem(result.address_v6[0].addr, address[0].addr, 16)

when defined(ESP_IDF_V4_0):
proc toIpAddress*(ip: ip4_addr_t): IpAddress =
Expand Down

0 comments on commit d47c050

Please sign in to comment.