Reviewed-by: Steven Dake <sdake@xxxxxxxxxx> On 01/16/2012 08:01 AM, Jan Friesse wrote: > Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx> > --- > exec/totemconfig.c | 20 ++++++++++++++++++++ > 1 files changed, 20 insertions(+), 0 deletions(-) > > diff --git a/exec/totemconfig.c b/exec/totemconfig.c > index 83c1eb2..3b3c2d5 100644 > --- a/exec/totemconfig.c > +++ b/exec/totemconfig.c > @@ -223,7 +223,9 @@ extern int totem_config_read ( > char ringnumber_key[ICMAP_KEYNAME_MAXLEN]; > char tmp_key[ICMAP_KEYNAME_MAXLEN]; > uint8_t u8; > + uint16_t u16; > char *cluster_name = NULL; > + int i; > > memset (totem_config, 0, sizeof (struct totem_config)); > totem_config->interfaces = malloc (sizeof (struct totem_interface) * INTERFACE_MAX); > @@ -375,6 +377,24 @@ extern int totem_config_read ( > } > icmap_iter_finalize(iter); > > + /* > + * Store automatically generated items back to icmap > + */ > + for (i = 0; i < totem_config->interface_count; i++) { > + 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_UDP; > if (icmap_get_string("totem.transport", &str) == CS_OK) { > if (strcmp (str, "udpu") == 0) { _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss