From 38c005e7c07b5ccaab3345dc8c66cbc27b95692a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 20 Jan 2020 23:31:55 -0800 Subject: fixes #1169 survey and xsurvey could use message cloning fixes #1160 Consider limiting maximum hop count to 15 fixes #1098 Maximum maxTTL should be compile time defined This doesn't expose the max-MaxTTL in the CMakeList.txt -- there is really no reason anyone should be changing it. This does not yet inline the message header into the nni_msg_t, but it is my intention to do so soon, and eliminate most of the conditional cases for failure on inserting into the header. --- src/protocol/survey0/xrespond.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/protocol/survey0/xrespond.c') diff --git a/src/protocol/survey0/xrespond.c b/src/protocol/survey0/xrespond.c index 73e541d3..c664f009 100644 --- a/src/protocol/survey0/xrespond.c +++ b/src/protocol/survey0/xrespond.c @@ -284,9 +284,7 @@ xresp0_recv_cb(void *arg) nni_msg_set_pipe(msg, p->id); // Store the pipe id in the header, first thing. - if (nni_msg_header_append_u32(msg, p->id) != 0) { - goto drop; - } + nni_msg_header_must_append_u32(msg, p->id); // Move backtrace from body to header hops = 1; @@ -346,7 +344,7 @@ xresp0_sock_set_maxttl(void *arg, const void *buf, size_t sz, nni_opt_type t) xresp0_sock *s = arg; int ttl; int rv; - if ((rv = nni_copyin_int(&ttl, buf, sz, 1, 255, t)) == 0) { + if ((rv = nni_copyin_int(&ttl, buf, sz, 1, NNI_MAX_MAX_TTL, t)) == 0) { nni_atomic_set(&s->ttl, ttl); } return (rv); -- cgit v1.2.3-70-g09d2