title: How to produce struct addrinfo from struct sockaddr?
body: <p>I have a struct sockaddr and need to make a struct addrinfo (specifically that, because that's what some other API wants). The IP address may be IPv4 or IPv6. What's the best way to handle that?</p>