I prefer not doing a resolve. A quick hardcoded macro to 0x0100007F would work beautifully for IPv4, is there one for IPv6 too?
This is for the bind() BSD sockets structure sockaddr_in6 and sockaddr_in
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.
man ipv6 is your friend 🙂
There is a
in6addr_loopbackvariable and for initializations a macroIN6ADDR_LOOPBACK_INIT.Be careful about the macro you want to do for IPv4, don’t forget that this is stored in network order, so the endianess of the system is an issue, here.