Merge pull request #3284 from lhftio/udp-multicast-hops

Add support for UDP multicast ttl (ZMQ_MULTICAST_HOPS)
This commit is contained in:
Luca Boccassi 2018-10-30 09:41:11 +00:00 committed by GitHub
commit 3863c869cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

17
RELICENSE/kfish.md Normal file
View File

@ -0,0 +1,17 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Conrad Parker that grants permission to
relicense its copyrights in the libzmq C++ library (ZeroMQ) under the
Mozilla Public License v2 (MPLv2) or any other Open Source Initiative
approved license chosen by the current ZeroMQ BDFL (Benevolent
Dictator for Life).
A portion of the commits made by the Github handle "kfish", with
commit author "Conrad Parker <conrad@metadecks.org>", are
copyright of Conrad Parker. This document hereby grants the libzmq
project team to relicense libzmq, including all past, present and
future contributions of the author listed above.
Conrad Parker
2018/10/30

View File

@ -149,6 +149,21 @@ void zmq::udp_engine_t::plug (io_thread_t *io_thread_, session_base_t *session_)
errno_assert (rc == 0);
#endif
int hops = _options.multicast_hops;
if (hops > 0) {
rc = setsockopt (_fd, level, IP_MULTICAST_TTL,
reinterpret_cast<char *> (&hops),
sizeof (hops));
} else {
rc = 0;
}
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert (rc != SOCKET_ERROR);
#else
errno_assert (rc == 0);
#endif
if (out->family () == AF_INET6) {
int bind_if = udp_addr->bind_if ();