Re: [PATCH 2/4] Set default multicast port if not specified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steven Dake napsal(a):
On 01/18/2012 12:19 AM, Jan Friesse wrote:
Steve,
it's automatic ring number. With rrp, it will work without any problem IF:
- user uses cluster_name, because then every ring has it's own mcast
address
- user use mcastaddr, but they are different for each ring
- user uses same mcastaddr for each ring, but must specify port

One of TODO is to "reuse" little more code from cman, and this time it
should be collision detection part (2 rings with same
mcastaddr:port(port-1), broadcast with same port, ...)


Does this change the default behavior of existing configuration files
(its not immediately obvious to me by looking at the patch).


Short answer: Slightly for incorrect config file and NO for correct.
Long answer:
- Previously incorrect files (without port) no longer fails to parse, but uses default port, so in other words, such files are correct now - Correct files (with port) still use port from config file and NOT default port.


If original config files are can run unalatered by this change, then
Reviewed-by: Steven Dake <sdake@xxxxxxxxxx>.  We don't want to break
original config files if at all possible (We already decided we are
breaking udpu, which is a relatively new feature, rather not break others).

As you will see in near future (hopefully today) with changes I've implemented even udpu config files will not break ;)

Honza


Regards
-steve

Honza

Steven Dake napsal(a):
This seems dubious - shouldn't port be specified per ring?

On 01/16/2012 08:01 AM, Jan Friesse wrote:
Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/totemconfig.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index 1f76413..83c1eb2 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -86,6 +86,8 @@
 #define RRP_PROBLEM_COUNT_THRESHOLD_MIN        2
 #define RRP_AUTORECOVERY_CHECK_TIMEOUT        1000
+#define DEFAULT_PORT 5405
+
 static char error_string_response[512];
static void add_totem_config_notification(struct totem_config
*totem_config);
@@ -296,7 +298,6 @@ extern int totem_config_read (
         member_count = 0;
ringnumber = atoi(ringnumber_key);
-
         /*
          * Get the bind net address
          */
@@ -340,7 +341,13 @@ extern int totem_config_read (
          * Get mcast port
          */
         snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN,
"totem.interface.%u.mcastport", ringnumber);
-        icmap_get_uint16(tmp_key,
&totem_config->interfaces[ringnumber].ip_port);
+        if (icmap_get_uint16(tmp_key,
&totem_config->interfaces[ringnumber].ip_port) != CS_OK) {
+            if (totem_config->broadcast_use) {
+                totem_config->interfaces[ringnumber].ip_port =
DEFAULT_PORT + (2 * ringnumber);
+            } else {
+                totem_config->interfaces[ringnumber].ip_port =
DEFAULT_PORT;
+            }
+        }
/*
          * Get the TTL


_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux