mirror of https://github.com/oxen-io/lokinet
Uncurse SockAddr's sockaddr* operator
The `const sockaddr*` conversion was returning a pointer to the sockaddr_in6, but with its family set to AF_INET, so the receiving code would have treated interpreting the result as a sockaddr_in pointer -- but it isn't, and trying to get the IPv4 from the mis-reinterpreted sockaddr_in6 fails; this then prevented uvw UDP binding (which uses the sockaddr* operator) from working. This changes it to always leave the family value at the proper value and using the ipv6_is_mapped_ipv4 check to determine when we have (and should return) a pointer to the sockaddr_in rather than the sockaddr_in6. Also fixes toString() to compare the full prefix instead of just bytes 10 and 11.pull/1557/head
parent
62fc1bbc48
commit
f8d5e106a0
Loading…
Reference in New Issue