I had a program that worked properly with Mac OS 10.6 but inexplicably fails in 10.8. The gist of it is that sendto is now returning -1 and setting errno to EINVAL (22). What’s going wrong?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The address I was giving sendto came from the first result of getaddrinfo. Turns out that first result is now an IPV6 result (using sockaddr_in6). sendto on OS 10.8 (at least for now) only seems to work with sockaddr_in address. Make sure to pass a hint to getaddrinfo that says you only want ipv4 addresses, i.e.
Read http://linux.die.net/man/3/getaddrinfo for more info.