The getAddrInfo call doesn't return the full struct (only to 0xfff1). Moreover the first couple of bytes are _not_ part of the IPv6 address and the first address byte is the 5th byte after 0x50 (0x20, 0x1, ...).
Frankly, I don't think it worth putting more work into the current solution. If you are interested just have a good c solution with 2 functions, one for IPv6 and one for IPv4 and then a Nim wrapper with an additional convenience function/proc that calls both and returns a seq[IpAddress] (from which btw. the C memory can be freed too once the C helpers are done and Nim has built up its result seq.
