4
0
Эх сурвалжийг харах

Remove the ttl option from udpu and rely on the kernel ttl setting.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Angus Salkeld 15 жил өмнө
parent
commit
48cbb33d11

+ 5 - 0
exec/totemconfig.c

@@ -477,6 +477,11 @@ int totem_config_validate (
 			error_reason = "Invalid TTL (should be 0..255)";
 			error_reason = "Invalid TTL (should be 0..255)";
 			goto parse_error;
 			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 &&
 		if (totem_config->interfaces[i].mcast_addr.family == AF_INET6 &&
 			totem_config->node_id == 0) {
 			totem_config->node_id == 0) {

+ 0 - 20
exec/totemudpu.c

@@ -1325,26 +1325,6 @@ static int totemudpu_build_sockets_ip (
 		return (-1);
 		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
 	 * Bind to unicast socket used for token send/receives
 	 * This has the side effect of binding to the correct interface
 	 * This has the side effect of binding to the correct interface

+ 1 - 0
man/corosync.conf.5

@@ -132,6 +132,7 @@ ttl
 This specifies the Time To Live (TTL). If you run your cluster on a routed
 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
 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.
 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
 .TP
 member
 member