diff --git a/CHANGES.txt b/CHANGES.txt index fb876491d..70046378e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,6 +12,8 @@ Revision 4.4.7, released 2018-12-29 sending SNMPv3 TRAP with non-default `contextName` would fail. - Fixed possible duplicate key occurrence in the `OrderedDict` following a race condition +- Fixed undefined name references in `inet_pton`/`inet_ntop` substitute + routines for IPv6 in `TRANSPORT-ADDRESS-MIB.py` Revision 4.4.6, released 2018-09-13 ----------------------------------- diff --git a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py index 38d12699a..213bb89c0 100644 --- a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py +++ b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py @@ -36,7 +36,7 @@ def inet_pton(address_family, ip_string): if address_family == socket.AF_INET: - return inet_aton(ip_string) + return socket.inet_aton(ip_string) elif address_family != socket.AF_INET6: raise socket.error( 'Unknown address family %s' % (address_family,) @@ -46,7 +46,7 @@ def inet_pton(address_family, ip_string): spaces = groups.count('') if '.' in groups[-1]: - groups[-1:] = ["%x" % x for x in struct.unpack("!HH", inet_aton(groups[-1]))] + groups[-1:] = ["%x" % x for x in struct.unpack("!HH", socket.inet_aton(groups[-1]))] if spaces == 1: idx = groups.index('') @@ -84,7 +84,7 @@ def inet_pton(address_family, ip_string): def inet_ntop(address_family, packed_ip): if address_family == socket.AF_INET: - return inet_ntop(packed_ip) + return socket.inet_ntop(packed_ip) elif address_family != socket.AF_INET6: raise socket.error( 'Unknown address family %s' % (address_family,)