mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-11-01 13:18:47 +00:00
totemconfig: generate mcast icmap items for UDP
Generating mcastaddr and mcastport in icmap make sense only for UDP transport. Signed-off-by: Bin Liu <bliu@suse.com> Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
parent
87a803ab94
commit
cf339c20c3
@ -1356,27 +1356,6 @@ extern int totem_config_read (
|
||||
"255.255.255.255", 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Store automatically generated items back to icmap
|
||||
*/
|
||||
for (i = 0; i < INTERFACE_MAX; i++) {
|
||||
if (!totem_config->interfaces[i].configured) {
|
||||
continue;
|
||||
}
|
||||
snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "totem.interface.%u.mcastaddr", i);
|
||||
if (icmap_get_string(tmp_key, &str) == CS_OK) {
|
||||
free(str);
|
||||
} else {
|
||||
str = (char *)totemip_print(&totem_config->interfaces[i].mcast_addr);
|
||||
icmap_set_string(tmp_key, str);
|
||||
}
|
||||
|
||||
snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "totem.interface.%u.mcastport", i);
|
||||
if (icmap_get_uint16(tmp_key, &u16) != CS_OK) {
|
||||
icmap_set_uint16(tmp_key, totem_config->interfaces[i].ip_port);
|
||||
}
|
||||
}
|
||||
|
||||
totem_config->transport_number = TOTEM_TRANSPORT_KNET;
|
||||
if (icmap_get_string("totem.transport", &str) == CS_OK) {
|
||||
if (strcmp (str, "udpu") == 0) {
|
||||
@ -1394,6 +1373,29 @@ extern int totem_config_read (
|
||||
free(str);
|
||||
}
|
||||
|
||||
/*
|
||||
* Store automatically generated items back to icmap only for UDP
|
||||
*/
|
||||
if (totem_config->transport_number == TOTEM_TRANSPORT_UDP) {
|
||||
for (i = 0; i < INTERFACE_MAX; i++) {
|
||||
if (!totem_config->interfaces[i].configured) {
|
||||
continue;
|
||||
}
|
||||
snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "totem.interface.%u.mcastaddr", i);
|
||||
if (icmap_get_string(tmp_key, &str) == CS_OK) {
|
||||
free(str);
|
||||
} else {
|
||||
str = (char *)totemip_print(&totem_config->interfaces[i].mcast_addr);
|
||||
icmap_set_string(tmp_key, str);
|
||||
}
|
||||
|
||||
snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "totem.interface.%u.mcastport", i);
|
||||
if (icmap_get_uint16(tmp_key, &u16) != CS_OK) {
|
||||
icmap_set_uint16(tmp_key, totem_config->interfaces[i].ip_port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check existence of nodelist
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user