summaryrefslogtreecommitdiff
path: root/pysnmp
diff options
context:
space:
mode:
authorelie <elie>2012-08-09 15:17:46 +0000
committerelie <elie>2012-08-09 15:17:46 +0000
commite00c17d7c154f0862d144144eddecd993e48345a (patch)
tree00872922acd20ac86d33ca7e10eadaf0f72a8130 /pysnmp
parent95127203c857006065e1d8e65471067d27c495b3 (diff)
downloadpysnmp-git-e00c17d7c154f0862d144144eddecd993e48345a.tar.gz
better input check for IpAddress
Diffstat (limited to 'pysnmp')
-rw-r--r--pysnmp/proto/rfc1902.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pysnmp/proto/rfc1902.py b/pysnmp/proto/rfc1902.py
index b12df7a2..121a4d64 100644
--- a/pysnmp/proto/rfc1902.py
+++ b/pysnmp/proto/rfc1902.py
@@ -46,15 +46,16 @@ class IpAddress(univ.OctetString):
value = [ int(x) for x in value.split('.') ]
except:
raise error.ProtocolError('Bad IP address syntax %s' % value)
+ value = univ.OctetString.prettyIn(self, value)
if len(value) != 4:
raise error.ProtocolError('Bad IP address syntax')
- return univ.OctetString.prettyIn(self, value)
+ return value
def prettyOut(self, value):
if value:
return '.'.join(
[ '%d' % x for x in self.__class__(value).asNumbers() ]
- )
+ )
else:
return ''