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

Steven McCoy steven.mccoy at miru.hk
Mon Aug 22 13:35:41 CEST 2011


On 22 August 2011 18:12, Martin Sustrik <sustrik at 250bpm.com> wrote:

> Hi Steve,
>
> Couple of comments:
>
> 1. Comment says "IPv6 literal addresses must be surrounded by square
> brackets" while the brackets are optional only.
>

>From the RFC's I read they are a MUST but the Linux APIs convert anything
making it optional.  I'm on a fence with this.


>
> 2. Brackets can be used on connecting side, but not on the binding side. If
> would be great if the behaviour was symmetric.
>

Ok, missed that.


>
> 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 *.
>
>
I can check the trace tomorrow, but I explicitly had to fix this with the
following in the patch:

@@ -248,11 +267,8 @@ int zmq::tcp_address_t::resolve_interface (char const
*interface_,
     int rc = resolve_nic_name (interface_, ipv4only_);
     if (rc != 0 && errno != ENODEV)
         return rc;
-    if (rc == 0) {
-        zmq_assert (out_addrlen <= (socklen_t) sizeof (address));
-        memcpy (&address, out_addr, out_addrlen);
+    if (rc == 0)
         return 0;
-    }

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110822/d9438e07/attachment.htm>


More information about the zeromq-dev mailing list