summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pysnmp/proto/rfc1155.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pysnmp/proto/rfc1155.py b/pysnmp/proto/rfc1155.py
index 35f6110b..65c450ef 100644
--- a/pysnmp/proto/rfc1155.py
+++ b/pysnmp/proto/rfc1155.py
@@ -66,9 +66,11 @@ class NetworkAddress(univ.Choice):
"""
cloned = univ.Choice.clone(self, **kwargs)
if value is not univ.noValue:
- # IpAddress is the only supported type, perhaps forever because
- # this is SNMPv1.
- if not isinstance(value, IpAddress):
+ if isinstance(value, NetworkAddress):
+ value = value.getComponent()
+ elif not isinstance(value, IpAddress):
+ # IpAddress is the only supported type, perhaps forever because
+ # this is SNMPv1.
value = IpAddress(value)
try:
tagSet = value.tagSet