Re: [PATCH 3/3] config: Ensure mcast address/port differs for rrp

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

 



Chrissie,


Is it also worth checking the port number in for each ring with
(portnumber-1) too as that's used for the unicast socket?

yep, good catch. I will send fixed patch.

Honza


Chrissie

On 05/11/14 15:42, Jan Friesse wrote:
When using multiple interfaces, it's necessary to use different
multicast address/port pair for each interface to make
rrp work correctly. This is now checked in parser.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
  exec/totemconfig.c  |   16 +++++++++++++++-
  man/corosync.conf.5 |    4 ++++
  2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index cab21fb..239a89f 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -474,7 +474,7 @@ int totem_config_validate (
      static char local_error_reason[512];
      char parse_error[512];
      const char *error_reason = local_error_reason;
-    int i;
+    int i, j;
      unsigned int interface_max = INTERFACE_MAX;

      if (totem_config->interface_count == 0) {
@@ -535,6 +535,20 @@ int totem_config_validate (
              error_reason =  "Not all bind address belong to the same
IP family";
              goto parse_error;
          }
+
+        /*
+         * Ensure mcast address/port differs
+         */
+        if (totem_config->transport_number == TOTEM_TRANSPORT_UDP) {
+            for (j = i + 1; j < totem_config->interface_count; j++) {
+                if
((totemip_equal(&totem_config->interfaces[i].mcast_addr,
+                    &totem_config->interfaces[j].mcast_addr) &&
+                    (totem_config->interfaces[i].ip_port ==
totem_config->interfaces[j].ip_port))) {
+                    error_reason = "Interfaces multicast address/port
pair must differ";
+                    goto parse_error;
+                }
+            }
+        }
      }

      if (totem_config->version != 2) {
diff --git a/man/corosync.conf.5 b/man/corosync.conf.5
index a2c8000..59fcf9f 100644
--- a/man/corosync.conf.5
+++ b/man/corosync.conf.5
@@ -218,6 +218,10 @@ If only one interface directive is specified,
none is automatically chosen.
  If multiple interface directives are specified, only active or
passive may
  be chosen.

+When using multiple interfaces, make sure to use different multicast
+address/port pair for each interface (this is checked by parser) to make
+rrp works.
+
  .TP
  netmtu
  This specifies the network maximum transmit unit.  To set this value
beyond


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

_______________________________________________
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