Comparing a peer's IPv6 address with localhost

Posted by indiv on Stack Overflow See other posts from Stack Overflow or by indiv
Published on 2010-05-18T23:40:32Z Indexed on 2010/05/19 2:30 UTC
Read the original article Hit count: 273

Filed under:
|
|

I have called getpeername on my connected socket and now have an IPv6 address of the connected peer. How do I tell whether my peer's IP address is localhost?

(the host name "localhost" is not defined in the target system's hosts file, so I need to work with IP addresses only)

© Stack Overflow or respective owner

Related posts about sockets

Related posts about IPv6