From d325e73b53c44e87ea4a2f2f91c9e84f61f7e889 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 11 Aug 2017 15:42:34 -0700 Subject: Fix TTL handling for pair1 protocol; more tests. --- src/protocol/pair/pair_v1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/protocol') diff --git a/src/protocol/pair/pair_v1.c b/src/protocol/pair/pair_v1.c index 6951088e..b76eecbb 100644 --- a/src/protocol/pair/pair_v1.c +++ b/src/protocol/pair/pair_v1.c @@ -224,7 +224,7 @@ pair1_pipe_recv_cb(void *arg) // If we bounced too many times, discard the message, but // keep getting more. - if (hdr >= (unsigned) s->ttl) { + if (hdr > (unsigned) s->ttl) { nni_msg_free(msg); nni_pipe_recv(npipe, &p->aio_recv); return; @@ -403,7 +403,7 @@ pair1_sock_setopt(void *arg, int opt, const void *buf, size_t sz) } break; case NNG_OPT_MAXTTL: - rv = nni_setopt_int(&s->ttl, buf, sz, 0, 255); + rv = nni_setopt_int(&s->ttl, buf, sz, 1, 255); break; default: rv = NNG_ENOTSUP; -- cgit v1.2.3-70-g09d2