by caf · 6y ago · 0 comments
Things are a bit trickier if it gets to getpeername(), since we want to have somewhat stable addresses. This is done by querying SO_PEERCRED and encoding[2] the pid for IPv4 or pid, uid and gid for IPv6 into the address.
In summary: Programs shouldn't get confused, but if they do, it's certainly a bug in ip2unix. Feel free to open an issue :-)
[1]: https://github.com/nixcloud/ip2unix/blob/d7d297ed68cdadc65dc...
[2]: https://github.com/nixcloud/ip2unix/blob/d7d297ed68cdadc65dc...