Blame SOURCES/bz773464-1-config-Make-sure-user-doesn-t-mix-IPv6-and-IPv4.patch

f1cb04
From 6c028d4d9c53decaa9469c792ac68fd2a886e7d9 Mon Sep 17 00:00:00 2001
f1cb04
From: Jan Friesse <jfriesse@redhat.com>
f1cb04
Date: Mon, 24 Nov 2014 10:25:05 +0100
f1cb04
Subject: [PATCH] config: Make sure user doesn't mix IPv6 and IPv4
f1cb04
f1cb04
Checking code was there, sadly not correct, so it was possible to enter
f1cb04
one bindnet addr as IPv4 and second as IPv6. Fix is trivial.
f1cb04
f1cb04
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
f1cb04
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
f1cb04
---
f1cb04
 exec/totemconfig.c |   11 ++++++-----
f1cb04
 1 files changed, 6 insertions(+), 5 deletions(-)
f1cb04
f1cb04
diff --git a/exec/totemconfig.c b/exec/totemconfig.c
f1cb04
index daf0719..3bcf49d 100644
f1cb04
--- a/exec/totemconfig.c
f1cb04
+++ b/exec/totemconfig.c
f1cb04
@@ -1055,21 +1055,22 @@ int totem_config_validate (
f1cb04
 			goto parse_error;
f1cb04
 		}
f1cb04
 
f1cb04
-		if (totem_config->broadcast_use == 0 && totem_config->transport_number == 0) {
f1cb04
+		if (totem_config->broadcast_use == 0 && totem_config->transport_number == TOTEM_TRANSPORT_UDP) {
f1cb04
 			if (totem_config->interfaces[i].mcast_addr.family != totem_config->interfaces[i].bindnet.family) {
f1cb04
 				error_reason = "Multicast address family does not match bind address family";
f1cb04
 				goto parse_error;
f1cb04
 			}
f1cb04
 
f1cb04
-			if (totem_config->interfaces[i].mcast_addr.family != totem_config->interfaces[i].bindnet.family) {
f1cb04
-				error_reason =  "Not all bind address belong to the same IP family";
f1cb04
-				goto parse_error;
f1cb04
-			}
f1cb04
 			if (totemip_is_mcast (&totem_config->interfaces[i].mcast_addr) != 0) {
f1cb04
 				error_reason = "mcastaddr is not a correct multicast address.";
f1cb04
 				goto parse_error;
f1cb04
 			}
f1cb04
 		}
f1cb04
+
f1cb04
+		if (totem_config->interfaces[0].bindnet.family != totem_config->interfaces[i].bindnet.family) {
f1cb04
+			error_reason =  "Not all bind address belong to the same IP family";
f1cb04
+			goto parse_error;
f1cb04
+		}
f1cb04
 	}
f1cb04
 
f1cb04
 	if (totem_config->version != 2) {
f1cb04
-- 
f1cb04
1.7.1
f1cb04