From 597afd4458799dcb9b13d02f9537177a19a9070d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 23 2016 05:02:54 +0000 Subject: import corosync-2.3.4-7.el7_2.3 --- diff --git a/SOURCES/bz1333397-1-totemconfig-Explicitly-pass-IP-version.patch b/SOURCES/bz1333397-1-totemconfig-Explicitly-pass-IP-version.patch new file mode 100644 index 0000000..7c31ab7 --- /dev/null +++ b/SOURCES/bz1333397-1-totemconfig-Explicitly-pass-IP-version.patch @@ -0,0 +1,71 @@ +From 60565b7da7d271651c30cd7fdca6e3f3eb5327ac Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Wed, 6 Apr 2016 15:49:09 +0200 +Subject: [PATCH] totemconfig: Explicitly pass IP version + +If resolver was set to prefer IPv6 (almost always) and interface section +was not defined (almost all config files created by pcs), IP version was +set to mcast_addr.family. Because mcast_addr.family was unset (reset to +zero), IPv6 address was returned causing failure in totemsrp. +Solution is to pass correct IP version stored in +totem_config->ip_version. + +Patch also simplifies get_cluster_mcast_addr. It was using mix of +explicitly passed IP version and bindnet IP version. + +Also return value of get_cluster_mcast_addr is now properly checked. + +Signed-off-by: Jan Friesse +Reviewed-by: Christine Caulfield +--- + exec/totemconfig.c | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/exec/totemconfig.c b/exec/totemconfig.c +index f232ea8..32c9f88 100644 +--- a/exec/totemconfig.c ++++ b/exec/totemconfig.c +@@ -446,7 +446,6 @@ static uint16_t generate_cluster_id (const char *cluster_name) + + static int get_cluster_mcast_addr ( + const char *cluster_name, +- const struct totem_ip_address *bindnet, + unsigned int ringnumber, + int ip_version, + struct totem_ip_address *res) +@@ -462,7 +461,7 @@ static int get_cluster_mcast_addr ( + clusterid = generate_cluster_id(cluster_name) + ringnumber; + memset (res, 0, sizeof(*res)); + +- switch (bindnet->family) { ++ switch (ip_version) { + case AF_INET: + snprintf(addr, sizeof(addr), "239.192.%d.%d", clusterid >> 8, clusterid % 0xFF); + break; +@@ -1088,7 +1087,7 @@ extern int totem_config_read ( + */ + if (icmap_get_string(iter_key, &str) == CS_OK) { + res = totemip_parse (&totem_config->interfaces[ringnumber].bindnet, str, +- totem_config->interfaces[ringnumber].mcast_addr.family); ++ totem_config->ip_version); + free(str); + } + +@@ -1105,10 +1104,13 @@ extern int totem_config_read ( + * (if available) + */ + res = get_cluster_mcast_addr (cluster_name, +- &totem_config->interfaces[ringnumber].bindnet, + ringnumber, + totem_config->ip_version, + &totem_config->interfaces[ringnumber].mcast_addr); ++ if (res != 0) { ++ *error_string = "Can't autogenerate multicast address"; ++ return -1; ++ } + } + + snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "totem.interface.%u.broadcast", ringnumber); +-- +1.7.1 + diff --git a/SOURCES/bz1338667-1-cmapctl-Handle-corosync-errors-in-print_key-func.patch b/SOURCES/bz1338667-1-cmapctl-Handle-corosync-errors-in-print_key-func.patch new file mode 100644 index 0000000..783c248 --- /dev/null +++ b/SOURCES/bz1338667-1-cmapctl-Handle-corosync-errors-in-print_key-func.patch @@ -0,0 +1,45 @@ +From 8ab7743068cc6cd5bf235d1ccae65de1d91784f0 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Tue, 17 May 2016 12:04:13 +0200 +Subject: [PATCH] cmapctl: Handle corosync errors in print_key func + +print_key handles only CS_ERR_TRY_AGAIN error. If different error is +returned, print_key loops forewer. + +Solution is to handle all errors. + +Signed-off-by: Jan Friesse +Reviewed-by: Christine Caulfield +--- + tools/corosync-cmapctl.c | 11 ++++++----- + 1 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/tools/corosync-cmapctl.c b/tools/corosync-cmapctl.c +index a8da499..d31a73d 100644 +--- a/tools/corosync-cmapctl.c ++++ b/tools/corosync-cmapctl.c +@@ -284,15 +284,16 @@ static void print_key(cmap_handle_t handle, + break; + } + +- if (err == CS_OK) ++ if (err == CS_OK) { + end_loop = 1; +- +- if (err == CS_ERR_TRY_AGAIN) { ++ } else if (err == CS_ERR_TRY_AGAIN) { + sleep(1); + no_retries++; +- } + +- if (no_retries > MAX_TRY_AGAIN) { ++ if (no_retries > MAX_TRY_AGAIN) { ++ end_loop = 1; ++ } ++ } else { + end_loop = 1; + } + }; +-- +1.7.1 + diff --git a/SPECS/corosync.spec b/SPECS/corosync.spec index 912abde..2c9dbc7 100644 --- a/SPECS/corosync.spec +++ b/SPECS/corosync.spec @@ -21,7 +21,7 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces Version: 2.3.4 -Release: 7%{?gitver}%{?dist}.1 +Release: 7%{?gitver}%{?dist}.3 License: BSD Group: System Environment/Base URL: http://www.corosync.org/ @@ -57,6 +57,8 @@ Patch26: bz1226842-1-Add-note-about-rrp-active-beeing-unsupported.patch Patch27: bz1225441-1-Log-Add-logrotate-configuration-file.patch Patch28: bz682771-3-Don-t-link-with-libz-when-not-needed.patch Patch29: bz1283067-1-totemudp-Move-udp-bind-so-that-multicast-works-with-.patch +Patch30: bz1333397-1-totemconfig-Explicitly-pass-IP-version.patch +Patch31: bz1338667-1-cmapctl-Handle-corosync-errors-in-print_key-func.patch %if 0%{?rhel} ExclusiveArch: i686 x86_64 s390x @@ -135,6 +137,8 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %patch27 -p1 -b .bz1225441-1 %patch28 -p1 -b .bz682771-3 %patch29 -p1 -b .bz1283067-1 +%patch30 -p1 -b .bz1333397-1 +%patch31 -p1 -b .bz1338667-1 %build %if %{with runautogen} @@ -398,6 +402,18 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/quorum_overview.8* %changelog +* Mon May 23 2016 Jan Friesse 2.3.4-7.3 +- Resolves: rhbz#1338667 + +- cmapctl: Handle corosync errors in print_key func (rhbz#1338667) +- merge upstream commit 8ab7743068cc6cd5bf235d1ccae65de1d91784f0 (rhbz#1338667) + +* Fri May 06 2016 Jan Friesse 2.3.4-7.2 +- Resolves: rhbz#1333397 + +- totemconfig: Explicitly pass IP version (rhbz#1333397) +- merge upstream commit 60565b7da7d271651c30cd7fdca6e3f3eb5327ac (rhbz#1333397) + * Wed Nov 18 2015 Jan Friesse 2.3.4-7.1 - Resolves: rhbz#1283067