From 505a9bce029e51540739c853a6c9eef0ecfb2e90 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 4 Apr 2018 11:07:56 -0700 Subject: fixes #329 type checking not done for setopt --- src/protocol/reqrep0/rep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/protocol/reqrep0/rep.c') diff --git a/src/protocol/reqrep0/rep.c b/src/protocol/reqrep0/rep.c index 5ee6c1be..f62406cd 100644 --- a/src/protocol/reqrep0/rep.c +++ b/src/protocol/reqrep0/rep.c @@ -353,13 +353,13 @@ rep0_pipe_putq_cb(void *arg) } static int -rep0_sock_setopt_raw(void *arg, const void *buf, size_t sz) +rep0_sock_setopt_raw(void *arg, const void *buf, size_t sz, int typ) { rep0_sock *s = arg; int rv; nni_mtx_lock(&s->lk); - rv = nni_setopt_bool(&s->raw, buf, sz); + rv = nni_copyin_bool(&s->raw, buf, sz, typ); nni_mtx_unlock(&s->lk); return (rv); } @@ -372,10 +372,10 @@ rep0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) } static int -rep0_sock_setopt_maxttl(void *arg, const void *buf, size_t sz) +rep0_sock_setopt_maxttl(void *arg, const void *buf, size_t sz, int typ) { rep0_sock *s = arg; - return (nni_setopt_int(&s->ttl, buf, sz, 1, 255)); + return (nni_copyin_int(&s->ttl, buf, sz, 1, 255, typ)); } static int -- cgit v1.2.3-70-g09d2