summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-09-16 14:03:42 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-09-16 14:03:42 +0200
commita71d00288008b7ed1dc91b6ad3d5fdf25a5e683e (patch)
treec4c1dde7b4cb638c88fc92647bdae836ab8216ea /src
parent4631fde7e385ea31e85f41290614afb9bda391c9 (diff)
parent7a5db6041f4f11ed502fa7446da900509dedb00f (diff)
Merge branch 'master' of git@github.com:sustrik/zeromq2
Diffstat (limited to 'src')
-rw-r--r--src/socket_base.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 10f1404..88ba43f 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -158,11 +158,18 @@ int zmq::socket_base_t::setsockopt (int option_, const void *optval_,
return 0;
case ZMQ_MCAST_LOOP:
- if (optvallen_ != sizeof (bool)) {
+ if (optvallen_ != sizeof (int64_t)) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if ((int64_t) *((int64_t*) optval_) == 0 ||
+ (int64_t) *((int64_t*) optval_) == 1) {
+ options.use_multicast_loop = (bool) *((int64_t*) optval_);
+ } else {
errno = EINVAL;
return -1;
}
- options.use_multicast_loop = optval_;
return 0;
default: