Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
NTPsec
ntpsec
Commits
c297c800
Commit
c297c800
authored
Sep 07, 2016
by
Gary E. Miller
💬
Browse files
Simplify gethostbyname() handling
parent
cff5f967
Changes
1
Hide whitespace changes
Inline
Side-by-side
ntpstats/ntpviz
View file @
c297c800
...
...
@@ -306,14 +306,11 @@ plot \
#
The
socket.gethostbyname
()
call
maps
DNS
names
to
IP
addresses
,
#
passing
through
literal
IPv4
addresses
unaltered.
However
,
#
it
barfs
on
either
literal
IPv6
addresses
or
refclock
names.
if
"("
in
key
or
"
::
"
in
key:
try:
ip =
socket.gethostbyname(key)
except:
#
ignore
it
ip =
key
else:
try:
ip =
socket.gethostbyname(key)
except:
#
ignore
it
ip =
key
if
ip
in
peerdict:
plot_data
+=
"\
n
".
join
(
peerdict
[
ip
])
+
"\
ne
\
n
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment