From: David T. <db...@us...> - 2002-05-11 05:15:23
|
Update of /cvsroot/pydns/pydns/DNS In directory usw-pr-cvs1:/tmp/cvs-serv26913 Modified Files: Lib.py Log Message: Whoops, I messed up the indentation. addr62bin() only worked if you had a textual address that had a compressed string (::). Index: Lib.py =================================================================== RCS file: /cvsroot/pydns/pydns/DNS/Lib.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Lib.py 8 May 2002 15:05:34 -0000 1.12 --- Lib.py 11 May 2002 05:15:13 -0000 1.13 *************** *** 112,128 **** s += parts[1] parts = s.split(':') ! for word in parts: ! try: ! i = int(word,16) ! if i > 65535 or i < 0: ! raise ValueError, 'bad IPv6 address' ! except: raise ValueError, 'bad IPv6 address' ! t = ((int(parts[0],16) << 16) + int(parts[1],16), \ ! (int(parts[2],16) << 16) + int(parts[3],16), \ ! (int(parts[4],16) << 16) + int(parts[5],16), \ ! (int(parts[6],16) << 16) + int(parts[7],16)) ! return(t) # Packing class --- 112,128 ---- s += parts[1] parts = s.split(':') ! for word in parts: ! try: ! i = int(word,16) ! if i > 65535 or i < 0: raise ValueError, 'bad IPv6 address' + except: + raise ValueError, 'bad IPv6 address' ! t = ((int(parts[0],16) << 16) + int(parts[1],16), \ ! (int(parts[2],16) << 16) + int(parts[3],16), \ ! (int(parts[4],16) << 16) + int(parts[5],16), \ ! (int(parts[6],16) << 16) + int(parts[7],16)) ! return(t) # Packing class *************** *** 699,702 **** --- 699,707 ---- # # $Log$ + # Revision 1.13 2002/05/11 05:15:13 dbt + # Whoops, I messed up the indentation. addr62bin() + # only worked if you had a textual address that had + # a compressed string (::). + # # Revision 1.12 2002/05/08 15:05:34 dbt # AAAA records and ip6.int/ip6.arpa reverse. |