diff options
author | Ilya Etingof <etingof@gmail.com> | 2018-12-30 00:02:25 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2018-12-30 00:02:25 +0100 |
commit | d1689d72724814fefbef512f84d417be399d308d (patch) | |
tree | 4390909ae33c908e961f35d788f69974e8d03c20 | |
parent | 49af9176c2bb92061e38d2988fafcbf6bcd27ca6 (diff) | |
download | pysnmp-git-d1689d72724814fefbef512f84d417be399d308d.tar.gz |
Fix undefined names in `TRANSPORT-ADDRESS-MIB.py`
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rw-r--r-- | pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index fb876491..70046378 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 38d12699..213bb89c 100644 --- a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py +++ b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py @@ -36,7 +36,7 @@ else: 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 @@ else: 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 @@ else: 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,) |