1. 31 Jul, 2017 1 commit
    • Brian Russell's avatar
      Add socket option BINDTODEVICE · b963542e
      Brian Russell authored
      Linux now supports Virtual Routing and Forwarding (VRF) as per:
      
      https://www.kernel.org/doc/Documentation/networking/vrf.txt
      
      In order for an application to bind or connect to a socket with an
      address in a VRF, they need to first bind the socket to the VRF device:
      
          setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);
      
      Note "dev" is the VRF device, eg. VRF "blue", rather than an interface
      enslaved to the VRF.
      
      Add a new socket option, ZMQ_BINDTODEVICE, to bind a socket to a device.
      In general, if a socket is bound to a device, eg. an interface, only
      packets received from that particular device are processed by the socket.
      
      If device is a VRF device, then subsequent binds/connects to that socket
      use addresses in the VRF routing table.
      b963542e
  2. 28 Jul, 2017 4 commits
    • Constantin Rack's avatar
      Merge pull request #2636 from bluca/tweetnacl_fd · 4a37ce9a
      Constantin Rack authored
      Problem: tweetnacl on *nix use of /dev/urandom is not thread safe
      4a37ce9a
    • Luca Boccassi's avatar
      Problem: reading from /dev/urandom is clunky · fbb6bbdc
      Luca Boccassi authored
      Solution: if available use the getrandom function as it doesn't
      require any synchronization, state or cleanup
      fbb6bbdc
    • Luca Boccassi's avatar
      Problem: tweetnacl leaks file descriptor on fork+exec · 2626fdfa
      Luca Boccassi authored
      Solution: open with O_CLOEXEC if available or set FD_CLOEXEC if not
      2626fdfa
    • Luca Boccassi's avatar
      Problem: fd leak in tweetnacl with one ctx per thread · e015a0f8
      Luca Boccassi authored
      Solution: add a crypto [de-]initialiser, refcounted and serialised
      through critical sections.
      This is necessary as utility APIs such as zmq_curve_keypair also
      call into the sodium/tweetnacl libraries and need the initialisation
      outside of the zmq context.
      Also the libsodium documentation explicitly says that sodium_init
      must not be called concurrently from multiple threads, which could
      have happened until now. Also the randombytes_close function does
      not appear to be thread safe either.
      This change guarantees that the library is initialised only once at
      any given time across the whole program.
      Fixes #2632
      e015a0f8
  3. 27 Jul, 2017 3 commits
  4. 22 Jul, 2017 2 commits
  5. 17 Jul, 2017 2 commits
  6. 14 Jul, 2017 6 commits
    • Constantin Rack's avatar
      Merge pull request #2625 from trofi/master · e1dfb2e3
      Constantin Rack authored
      configure.ac: allow user to disable libunwind discovery via --disable-libunwind
      e1dfb2e3
    • Sergei Trofimovich's avatar
      configure.ac: allow user to disable libunwind discovery via --disable-libunwind · 88487e7d
      Sergei Trofimovich authored
      on ia64 architecture libunwind comes with gcc. Unfortunately
      libunwind is not directly usable as-is and fails at link time:
      
      ```
          ia64-unknown-linux-gnu-g++ -o perf/.libs/local_lat perf/local_lat.o src/.libs/libzmq.so -lsodium -lrt -lpthread -ldl
          src/.libs/libzmq.so: undefined reference to `_ULia64_step'
      ```
      
      The change adds --{enable,disable}-libunwind flag to control
      automatic dependency. The default is unchanged: use if available.
      Signed-off-by: 's avatarSergei Trofimovich <slyfox@gentoo.org>
      88487e7d
    • Luca Boccassi's avatar
      Merge pull request #2624 from msune/master · dfcf396d
      Luca Boccassi authored
      Problem: adapt, clarify docs ZMQ_ROUTER_MANDATORY
      dfcf396d
    • Marc Sune's avatar
      Problem: adapt, clarify docs ZMQ_ROUTER_MANDATORY · 609c1312
      Marc Sune authored
      Solution:
      
      * Document the new behaviour when generating 'ZMQ_POLLOUT' events
        for ZMQ_ROUTER sockets with 'ZMQ_ROUTER_MANDATORY' set to `1`
      * Add clarifications for 'ZMQ_ROUTER' socket when
        'ZMQ_ROUTER_MANDATORY' is set to `1`
      609c1312
    • Luca Boccassi's avatar
      Merge pull request #2622 from msune/master · bba4a937
      Luca Boccassi authored
      Fix ROUTER's xhas_out() in MANDATORY mode
      bba4a937
    • Marc Sune's avatar
      Fix ROUTER's xhas_out() in MANDATORY mode · b7b89a8f
      Marc Sune authored
      Before this commit, xhas_out() was returning true regardless. This
      was correct before the ZMQ_ROUTER_MANDATORY flag as introduced.
      However, ZMQ_POLLOUT.
      
      With this commit, _if_ ZMQ_ROUTER_MANDATORY is set, xhas_out() will
      return false if ALL peer's outgoing pipes are full.
      
      There is an outstanding high-level design question:
      
      If ZMQ_ROUTER_MANDATORY is set, and zmq_poll() waits for ZMQ_POLLOUT
      events, zmq_poll() will immediately wake up if only 1 pipe has
      room to send, regardless of the peer, creating a busy loop of
      zmq_poll() wake-up, zmq_send() (EAGAIN). There is no way for
      the application to selectively wait for ZMQ_POLLOUT for specific
      peer(s), which seems somehow necessary in ZMQ_ROUTER_MANDATORY.
      
      This discussion will be addressed in a separate issue.
      Signed-off-by: 's avatarMarc Sune <marc@voltanet.io>
      Signed-off-by: 's avatarFredi Raspall <fredi@voltanet.io>
      b7b89a8f
  7. 01 Jul, 2017 2 commits
  8. 29 Jun, 2017 2 commits
  9. 27 Jun, 2017 4 commits
  10. 23 Jun, 2017 2 commits
  11. 22 Jun, 2017 2 commits
  12. 21 Jun, 2017 1 commit
  13. 15 Jun, 2017 1 commit
  14. 14 Jun, 2017 3 commits
  15. 13 Jun, 2017 3 commits
  16. 12 Jun, 2017 2 commits