This fixes https://fedorahosted.org/freeipa/ticket/2379 by using inet_pton instead of inet_aton.


--
PetrĀ³
>From 5f81db8537b7af6e23acc1ad07d3a8a5118d41b7 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Wed, 15 Feb 2012 05:11:24 -0500
Subject: [PATCH] Use stricter semantics when checking IP address for DNS records

https://fedorahosted.org/freeipa/ticket/2379
---
 ipalib/plugins/dns.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index fe32efccdf9b0e0d7d8d58dd9896205ef369ec5a..1582f7b122b0f35e1fd156883e28cea1e5402f42 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -196,7 +196,7 @@ def _reverse_zone_name(netstr):
 
 def _validate_ipaddr(ugettext, ipaddr, ip_version=None):
     try:
-        ip = netaddr.IPAddress(ipaddr)
+        ip = netaddr.IPAddress(ipaddr, flags=netaddr.INET_PTON)
 
         if ip_version is not None:
             if ip.version != ip_version:
-- 
1.7.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to