Open NoAnyLove opened 1 year ago
According to the following references, the valid TTL, which is referred as multicast hops in zmq, is from 0 to 255.
It is useful to set it to 0 when user wants to multicast data to consumers on the same host.
However, several checks in zmq code prevent user to set ZMQ_MULTICAST_HOPS to , e.g.,
Besides, it does not have upper limit check either (<= 255).
#include <stdio.h> #include <zmq.h> int main() { void* ctx = zmq_ctx_new(); void* socket = zmq_socket(ctx, ZMQ_RADIO); int value = 0; int rc = zmq_setsockopt(socket, ZMQ_MULTICAST_HOPS, &value, sizeof(value)); printf("rc=%d\n", rc); }
It outputs,
rc=-1
I'm expecting it works and rc returns 0.
Issue description
According to the following references, the valid TTL, which is referred as multicast hops in zmq, is from 0 to 255.
It is useful to set it to 0 when user wants to multicast data to consumers on the same host.
However, several checks in zmq code prevent user to set ZMQ_MULTICAST_HOPS to , e.g.,
Besides, it does not have upper limit check either (<= 255).
Minimal test code / Steps to reproduce the issue
What's the actual result? (include assertion message & call stack if applicable)
It outputs,
What's the expected result?
I'm expecting it works and rc returns 0.