mirror of https://github.com/dirtbags/moth.git
Make multicast packets have >1 hops
This commit is contained in:
parent
677c2d9a68
commit
da4e850386
|
@ -1,5 +1,4 @@
|
||||||
CFLAGS = -Wall -Werror
|
CFLAGS = -Wall -Werror
|
||||||
LDFLAGS = -static
|
|
||||||
TARGETS = multicaster-server multicaster-client
|
TARGETS = multicaster-server multicaster-client
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
|
@ -47,8 +47,8 @@ int main(int argc, char *argv[])
|
||||||
/* Create socket for sending multicast datagrams */
|
/* Create socket for sending multicast datagrams */
|
||||||
if ((sock = socket(multicastAddr->ai_family, multicastAddr->ai_socktype, 0)) == -1) DieWithError("socket() failed");
|
if ((sock = socket(multicastAddr->ai_family, multicastAddr->ai_socktype, 0)) == -1) DieWithError("socket() failed");
|
||||||
|
|
||||||
//int scope_id = if_nametoindex("eth0");
|
int hops = 5;
|
||||||
//if (setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_IF, (const char *) &scope_id, sizeof(scope_id)) != 0) DieWithError("setsockopt(MULTICAST_IF) failed");
|
if (setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &hops, sizeof(hops)) != 0) DieWithError("setsockopt(MULTICAST_HOPS) failed");
|
||||||
|
|
||||||
for (;;) /* Run forever */
|
for (;;) /* Run forever */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue