From b232ad463cf43596cdf397e51469df13a89e83fa Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Fri, 2 Sep 2016 17:39:01 +0200 Subject: Show warning when net/broadcast IP address is used in installer https://fedorahosted.org/freeipa/ticket/5814 Reviewed-By: David Kupka --- client/ipa-client-install | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'client') diff --git a/client/ipa-client-install b/client/ipa-client-install index 4a263b3d0..6330f1d28 100755 --- a/client/ipa-client-install +++ b/client/ipa-client-install @@ -1651,6 +1651,20 @@ def update_dns(server, hostname, options): root_logger.info("Failed to determine this machine's ip address(es).") return + for ip in update_ips: + if ip.is_network_addr(): + root_logger.warning("IP address %s might be network address", ip) + # fixme: once when loggers will be fixed, we can remove this print + print( + "WARNING: IP address {} might be network address".format(ip), + file=sys.stderr) + if ip.is_broadcast_addr(): + root_logger.warning("IP address %s might be broadcast address", ip) + # fixme: once when loggers will be fixed, we can remove this print + print( + "WARNING: IP address {} might be broadcast address".format(ip), + file=sys.stderr) + update_txt = "debug\n" update_txt += ipautil.template_str(DELETE_TEMPLATE_A, dict(HOSTNAME=hostname)) -- cgit