mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-21 02:00:36 +01:00
Reverted fix for #393, was already fixed
This commit is contained in:
parent
73f960e739
commit
8d64fc6af8
@ -371,10 +371,10 @@ zmq::tcp_address_t::tcp_address_t (const sockaddr *sa, socklen_t sa_len)
|
|||||||
zmq_assert(sa && sa_len > 0);
|
zmq_assert(sa && sa_len > 0);
|
||||||
|
|
||||||
memset (&address, 0, sizeof (address));
|
memset (&address, 0, sizeof (address));
|
||||||
if (sa->sa_family == AF_INET && (size_t) sa_len >= (socklen_t) sizeof (address.ipv4))
|
if (sa->sa_family == AF_INET && sa_len >= (socklen_t) sizeof (address.ipv4))
|
||||||
memcpy(&address.ipv4, sa, sizeof (address.ipv4));
|
memcpy(&address.ipv4, sa, sizeof (address.ipv4));
|
||||||
else
|
else
|
||||||
if (sa->sa_family == AF_INET6 && (size_t) sa_len >= (socklen_t) sizeof (address.ipv6))
|
if (sa->sa_family == AF_INET6 && sa_len >= (socklen_t) sizeof (address.ipv6))
|
||||||
memcpy(&address.ipv6, sa, sizeof (address.ipv6));
|
memcpy(&address.ipv6, sa, sizeof (address.ipv6));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,7 +576,7 @@ int zmq::tcp_address_mask_t::to_string (std::string &addr_)
|
|||||||
|
|
||||||
const bool zmq::tcp_address_mask_t::match_address (const struct sockaddr *ss, const socklen_t ss_len) const
|
const bool zmq::tcp_address_mask_t::match_address (const struct sockaddr *ss, const socklen_t ss_len) const
|
||||||
{
|
{
|
||||||
zmq_assert (address_mask != -1 && ss != NULL && (socklen_t) ss_len >= (socklen_t) sizeof (struct sockaddr));
|
zmq_assert (address_mask != -1 && ss != NULL && ss_len >= (socklen_t) sizeof (struct sockaddr));
|
||||||
|
|
||||||
if (ss->sa_family != address.generic.sa_family)
|
if (ss->sa_family != address.generic.sa_family)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user