[Git][NTPsec/ntpsec][master] Changed assocAddress handler to not cough and die on invalid value.
Ian Bruene
gitlab at mg.gitlab.com
Sun Jan 7 12:22:45 UTC 2018
Ian Bruene pushed to branch master at NTPsec / ntpsec
Commits:
480e5b41 by Ian Bruene at 2018-01-07T06:20:55-06:00
Changed assocAddress handler to not cough and die on invalid value.
- - - - -
1 changed file:
- ntpclients/ntpsnmpd.py
Changes:
=====================================
ntpclients/ntpsnmpd.py
=====================================
--- a/ntpclients/ntpsnmpd.py
+++ b/ntpclients/ntpsnmpd.py
@@ -658,7 +658,15 @@ class DataSource: # This will be broken up in future to be less NTP-specific
pieces = addr.split(":")
else:
pieces = []
- srcadr = [int(x) for x in pieces]
+ srcadr = []
+ for x in pieces:
+ try:
+ srcadr.append(int(x))
+ except ValueError:
+ # Have gotten x == "" before. Skip over.
+ # Still try to return data because it is potential
+ # debugging information.
+ pass
return ax.Varbind(ax.VALUE_OCTET_STR, oid, srcadr)
return self.dynamicCallbackSkeleton(handler)
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/480e5b4146ae5d7ac72aac6b59de2625696a78b1
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/480e5b4146ae5d7ac72aac6b59de2625696a78b1
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180107/3602d711/attachment.html>
More information about the vc
mailing list