diff --git a/exec/totemconfig.c b/exec/totemconfig.c index 7039ba06..0b9732b4 100644 --- a/exec/totemconfig.c +++ b/exec/totemconfig.c @@ -477,6 +477,11 @@ int totem_config_validate ( error_reason = "Invalid TTL (should be 0..255)"; goto parse_error; } + if (totem_config->transport_number != TOTEM_TRANSPORT_UDP && + totem_config->interfaces[i].ttl != 1) { + error_reason = "Can only set ttl on multicast transport types"; + goto parse_error; + } if (totem_config->interfaces[i].mcast_addr.family == AF_INET6 && totem_config->node_id == 0) { diff --git a/exec/totemudpu.c b/exec/totemudpu.c index 1cf3cf6b..2d6a3da9 100644 --- a/exec/totemudpu.c +++ b/exec/totemudpu.c @@ -1302,7 +1302,6 @@ static int totemudpu_build_sockets_ip ( struct sockaddr_storage sockaddr; int addrlen; int res; - int flag; unsigned int recvbuf_size; unsigned int optlen = sizeof (recvbuf_size); @@ -1325,26 +1324,6 @@ static int totemudpu_build_sockets_ip ( return (-1); } - /* - * Set packets TTL - */ - flag = instance->totem_interface->ttl; - if (bindnet_address->family == AF_INET6) { - res = setsockopt (instance->token_socket, IPPROTO_IPV6, - IPV6_UNICAST_HOPS, &flag, sizeof (flag)); - if (res == -1) { - perror ("set udpu v6 TTL"); - return (-1); - } - } else { - res = setsockopt(instance->token_socket, IPPROTO_IP, IP_TTL, - &flag, sizeof(flag)); - if (res == -1) { - perror ("set udpu v4 TTL"); - return (-1); - } - } - /* * Bind to unicast socket used for token send/receives * This has the side effect of binding to the correct interface diff --git a/man/corosync.conf.5 b/man/corosync.conf.5 index eaf58c45..2ebf8029 100644 --- a/man/corosync.conf.5 +++ b/man/corosync.conf.5 @@ -132,6 +132,7 @@ ttl This specifies the Time To Live (TTL). If you run your cluster on a routed network then the default of "1" will be too small. This option provides a way to increase this up to 255. The valid range is 0..255. +Note that this is only valid on multicast transport types. .TP member