Is ttl an integer or char? I think you need to make it a char or u_char.
And you don't need to have root priviledges to do this.
Hope this helps.
Tuan
On Mon, 11 Oct 1999, S.RadhaKrishna wrote:
> Hi all,
> I'm using the following call to set the ttl value (after doing a successful
> socket call)
> ------
> ttl=5;
> if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL,
> (char *)&ttl, sizeof(ttl)) < 0)
> {
> printf("\nserv.c: setting of TTL value failed \n");
> perror("setsockopt");
> exit(1);
> }
> ---------
>
> It gives the following message :
> ------
> serv.c: setting of TTL value failed
> setsockopt: Invalid argument
> --------
>
> I tried with "root" perms also. But it didn't help. I would be
> thankful if any one can provide me some help on this.
>
> PS: I'm not sure whether I'm added to this list. Please mark a copy to
> "[EMAIL PROTECTED]"
>
> regards
> radha
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to [EMAIL PROTECTED]
>
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]