Просмотр исходного кода

Fix the ttl defaults and range

1) both IPv4 and IPv6 mcast should default to ttl=1
2) the range should be 0..255
   0 is valid meaning localhost only (cluster of one)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Angus Salkeld 15 лет назад
Родитель
Сommit
86ada30aa4
2 измененных файлов с 4 добавлено и 8 удалено
  1. 3 7
      exec/totemconfig.c
  2. 1 1
      man/corosync.conf.5

+ 3 - 7
exec/totemconfig.c

@@ -394,11 +394,7 @@ printf ("couldn't find totem handle\n");
 		/*
 		/*
 		 * Get the TTL
 		 * Get the TTL
 		 */
 		 */
-		if (totem_config->interfaces[ringnumber].mcast_addr.family == AF_INET6) {
-			totem_config->interfaces[ringnumber].ttl = 255;
-		} else {
-			totem_config->interfaces[ringnumber].ttl = 1;
-		}
+		totem_config->interfaces[ringnumber].ttl = 1;
 		if (!objdb_get_string (objdb, object_interface_handle, "ttl", &str)) {
 		if (!objdb_get_string (objdb, object_interface_handle, "ttl", &str)) {
 			totem_config->interfaces[ringnumber].ttl = atoi (str);
 			totem_config->interfaces[ringnumber].ttl = atoi (str);
 		}
 		}
@@ -477,8 +473,8 @@ int totem_config_validate (
 			goto parse_error;
 			goto parse_error;
 		}
 		}
 
 
-		if (totem_config->interfaces[i].ttl > 255 || totem_config->interfaces[i].ttl < 1) {
-			error_reason = "Invalid TTL (should be 1..255)";
+		if (totem_config->interfaces[i].ttl > 255 || totem_config->interfaces[i].ttl < 0) {
+			error_reason = "Invalid TTL (should be 0..255)";
 			goto parse_error;
 			goto parse_error;
 		}
 		}
 
 

+ 1 - 1
man/corosync.conf.5

@@ -131,7 +131,7 @@ please configure the mcastports with a gap.
 ttl
 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.
+a way to increase this up to 255. The valid range is 0..255.
 
 
 .TP
 .TP
 member
 member