[zeromq-dev] [PATCH] IPv6 changes to 4.0

Martin Sustrik sustrik at 250bpm.com
Mon Aug 22 13:51:00 CEST 2011


On 08/22/2011 01:35 PM, Steven McCoy wrote:

>     3. When trying to bind to lo:5555 strace reports following (Linux):
>
>     bind(10, {sa_family=AF_INET6, sin6_port=htons(5555),
>     inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0,
>     sin6_scope_id=0}, 28) = 0
>
>     Which AFAIU is the same as *.

What happens is the eth0 resolves to 2 addresses (IPv4 and IPv6) which 
triggers this code:

     //  Multiple matching interfaces, therefore return entire adapter.
     if (found > 1) {
         sockaddr_in6 sin6;
         memset (&sin6, 0, sizeof (sin6));
         sin6.sin6_family = AF_INET6;
         memcpy (&sin6.sin6_addr, &in6addr_any, sizeof (in6addr_any));
         sin6.sin6_scope_id = sin6_scope_id;
         memcpy (&address, &sin6, sizeof (sin6));
     }

Which in turn binds to all interfaces.

What was the intention here?

Martin



More information about the zeromq-dev mailing list