QNX4: UDP / Multicast settings for TTL

I’m using QNX4, Socklet v4.25K. One of the tasks was to send out
broadcast UDP messages, this code works fine when connecting directly
to the destination device. If I were to reroute it through a router
for it to redistribute, it does not work as the TTL value is set to

  1. I’ve checked to docs but there is no reference to TTL settings,
    I’ve tried various setsockopt() but the TTL remained at 1. Anyone can
    help me how to change the TTL?

Basically the code is fairly straight-forward:

===

UDPsock = socket(AF_INET, SOCK_DGRAM, 0);
if (UDPsock < 0) {
perror(“opening datagram socket”);
exit(1);
}

/* Optional - NO EFFECT whatsoever */
optval = 1;
res = setsockopt(UDPsock, SOL_SOCKET, SO_BROADCAST, (char *) optval,
sizeof(optval));

Log(“setsockopt(SOL_SOCKET) returned %d”, res);
/* End of Optional section */

optval = 7;
res = setsockopt(UDPsock, IPPROTO_IP, IP_TTL, (char *) &optval,
sizeof(optval));

Log(“setsockopt(IPPROTO_IP) returned %d”, res);

====

Thanks,

  • Huy -

On Sun, 15 Apr 2007 12:30:59 +0400, Huy
<huy.duc.nguyen@gmail-dot-com.no-spam.invalid> wrote:

I’m using QNX4, Socklet v4.25K.
You must be using the Tcpip v5.0 to be able to multicast properly.

Tony.