Commit c297c800 authored by Gary E. Miller's avatar Gary E. Miller 💬
Browse files

Simplify gethostbyname() handling

parent cff5f967
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment