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

Steven McCoy steven.mccoy at miru.hk
Mon Aug 22 09:14:23 CEST 2011

Martin missed an updated patch from before, here it is again with some

* Fix NIC name binding always returning inaddr-any/in6addr-any.
* Binding upon a NIC name in IPv6 may resolve to multiple interfaces, use
the IPv6 scope identifier to force the bind.
* Use SO_BINDTODEVICE on Linux to workaround lack of in6addr_any:scope_id
* Add support for IPv6 literal addresses.


Basically NIC binding isn't too hot, so what we have here is when you bind
like this:

*./perf/local_thr tcp://eth0:5555 1 100000*

You are actually getting the same as this:

*./perf/local_thr tcp://*:5555 1 100000*

On Linux I have added a workaround that you can use system capabilities to
force the bind:

*sudo execcap 'cap_net_raw=ep' ./perf/local_thr tcp://eth0:5555 1 100000*
On modern distro's this utility has disappeared, the file system tools don't
appear to work out-of-the-box, but capsh does:

*sudo capsh --caps="cap_net_raw=ep" -- -c "./perf/local_thr tcp://eth0:5555
1 100000"*
That is the same capability as supporting ICMP, raw sockets, and IP/PGM.

To test simply try using another adapter such as loopback and it should wait
on reconnecting.

*./perf/remote_thr tcp:// 1 100000*


Nothing particularly amazing, but to avoid confusion with port specifiers
the RFC recommend that all IPv6 literal addresses be enclosed within square
brackets.  Note in dual-stack mode IPv4 addresses are also valid.


*./perf/remote_thr tcp://[fe80::230:1bff:feb7:a209%eth0]:5555 1 100000*


The TCP stack isn't as forgiving as the UDP stack, when using link-local
addresses, even if you only have one available, the scope identifier must be


*./perf/remote_thr tcp://[fe80::230:1bff:feb7:a209%eth0]:5555 1 100000*

*./perf/remote_thr tcp://[fe80::230:1bff:feb7:a209]:5555 1 100000*
Assertion failed: s == retired_fd (tcp_connecter.cpp:184)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110822/629c047a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Binding-upon-a-NIC-name-in-IPv6-may-resolve-to-multi.patch
Type: text/x-patch
Size: 5691 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110822/629c047a/attachment.bin>

More information about the zeromq-dev mailing list