[PATCH 2/2] Display warning if multiple IPs are found

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

 



Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/totemip.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/exec/totemip.c b/exec/totemip.c
index 77bcad5..35741c5 100644
--- a/exec/totemip.c
+++ b/exec/totemip.c
@@ -53,12 +53,15 @@
 
 #include <corosync/totem/totemip.h>
 #include <corosync/swab.h>
+#include <corosync/logsys.h>
 
 #define LOCALHOST_IPV4 "127.0.0.1"
 #define LOCALHOST_IPV6 "::1"
 
 #define NETLINK_BUFSIZE 16384
 
+LOGSYS_DECLARE_SUBSYS ("IP");
+
 #ifdef SO_NOSIGPIPE
 void totemip_nosigpipe(int s)
 {
@@ -287,6 +290,11 @@ int totemip_parse(struct totem_ip_address *totemip, const char *addr, int family
 	else
 		memcpy(totemip->addr, &sa6->sin6_addr, sizeof(struct in6_addr));
 
+	if (ainfo->ai_next != NULL) {
+		log_printf(LOGSYS_LEVEL_WARNING,
+		    "More then one address found for %s. Please consider using /etc/hosts", addr);
+	}
+
 	freeaddrinfo(ainfo);
 	return 0;
 }
-- 
1.7.1

_______________________________________________
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