I have an ipv4 server that accepts connections only through localhost (using INADDR_LOOPBACK). I would like to convert this server to a dual ipv6 / ipv4 stack. However, use in6addr_loopbackonly allows connections to ::1.
I found that I can accept ipv4 and ipv6 connections at the same time using in6addr_any, but since this also allows connections from anywhere, this is not useful for my particular case.
Is it possible to bind localhost ( ::1) and ipv4 localhost ( 127.0.0.1) to ipv6 at the same time ?
source
share