summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2018-12-30 00:02:25 +0100
committerIlya Etingof <etingof@gmail.com>2018-12-30 00:02:25 +0100
commitd1689d72724814fefbef512f84d417be399d308d (patch)
tree4390909ae33c908e961f35d788f69974e8d03c20
parent49af9176c2bb92061e38d2988fafcbf6bcd27ca6 (diff)
downloadpysnmp-git-d1689d72724814fefbef512f84d417be399d308d.tar.gz
Fix undefined names in `TRANSPORT-ADDRESS-MIB.py`
-rw-r--r--CHANGES.txt2
-rw-r--r--pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py6
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,)