Problem: Tests for different TIPC address types missing (#2956)

* Tests for different TIPC address types and code cleanup

* Adds tests for binding/connecting with different TIPC address types
  using Unity
* Adds error checking for address type misuse
This commit is contained in:
Pontus.Skoeldstroem
2018-03-07 18:31:26 +01:00
committed by Luca Boccassi
parent 40c6c1a7c9
commit 7abb8388d6
6 changed files with 213 additions and 56 deletions

View File

@@ -899,6 +899,15 @@ int zmq::socket_base_t::connect (const char *addr_)
LIBZMQ_DELETE (paddr);
return -1;
}
sockaddr_tipc *saddr =
(sockaddr_tipc *) paddr->resolved.tipc_addr->addr ();
// Cannot connect to random Port Identity
if (saddr->addrtype == TIPC_ADDR_ID
&& paddr->resolved.tipc_addr->is_random ()) {
LIBZMQ_DELETE (paddr);
errno = EINVAL;
return -1;
}
}
#endif
#if defined ZMQ_HAVE_VMCI