[Git][NTPsec/ntpsec][master] 4 commits: Typos.
Eric S. Raymond
gitlab at mg.gitlab.com
Wed Sep 7 23:42:39 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
9fbcd093 by Matt Selsky at 2016-09-07T19:39:53-04:00
Typos.
- - - - -
29cc8210 by Matt Selsky at 2016-09-07T19:39:53-04:00
Remove unused variable in ntpwait
- - - - -
2fa56891 by Matt Selsky at 2016-09-07T19:39:53-04:00
Fix undefined variables and already defined methods as identified by pylint.
- - - - -
b8d31290 by Matthew Van Gundy at 2016-09-07T19:42:25-04:00
Only reset peer event counter when we see an event of a different type.
- - - - -
5 changed files:
- ntpd/ntp_control.c
- ntpq/pyntpq
- ntpstats/ntpviz
- ntpwait/ntpwait
- pylib/packet.py
Changes:
=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -4369,7 +4369,7 @@ report_event(
uint8_t errlast;
errlast = (uint8_t)err & ~PEER_EVENT;
- if (peer->last_event == errlast)
+ if (peer->last_event != errlast)
peer->num_events = 0;
if (peer->num_events >= CTL_PEER_MAXEVENTS)
return;
=====================================
ntpq/pyntpq
=====================================
--- a/ntpq/pyntpq
+++ b/ntpq/pyntpq
@@ -317,7 +317,7 @@ function: exit ntpq
usage: exit
""")
do_quit = do_exit
- def help_exit(self):
+ def help_quit(self):
sys.stdout.write("""\
function: exit ntpq
usage: quit
@@ -648,15 +648,15 @@ if __name__ == '__main__':
for (switch, val) in options:
if switch in ("-4", "--ipv4"):
- interpreter.ai_family = AF_INET
+ interpreter.ai_family = socket.AF_INET
elif switch in ("-6", "--ipv6"):
- interpreter.ai_family = AF_INET6
+ interpreter.ai_family = socket.AF_INET6
elif switch in ("-c", "--command"):
interpreter.ccmds.append(val)
elif switch in ("-d", "--debug"):
interpreter.debug += 1
elif switch in ("-D", "--set-debug-level"):
- interpreter.debug = int(ntp_optarg)
+ interpreter.debug = int(val)
elif switch in ("-h", "--help"):
print(usage)
raise SystemExit(0)
@@ -678,7 +678,7 @@ if __name__ == '__main__':
sys.stderr.write(usage)
raise SystemExit(1)
- if interpreter.interactive and (opt_command or opt_peers):
+ if interpreter.interactive and len(interpreter.ccmds) > 0:
sys.stderr.write("%s: invalid option combination.\n" % progname)
raise SystemExit(1)
@@ -688,9 +688,9 @@ if __name__ == '__main__':
for token in arguments:
if token.startswith("-"):
if '4' == token[1]:
- session.ai_family = AF_INET
+ session.ai_family = socket.AF_INET
elif '6' == token[1]:
- session.ai_family = AF_INET6
+ session.ai_family = socket.AF_INET6
else:
interpreter.chosts.append((token, session.ai_family))
=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -784,7 +784,7 @@ or server.</dd>
<dd>Sigma denotes the standard deviation (SD) and is centered on the
arithmetic mean of the data set. The SD is simply the square root of
the variance of the data set. Two sigma is simply twice the standard
-deviation. Three Sigma is three times sigma. Smaller is better.</dd>
+deviation. Three sigma is three times sigma. Smaller is better.</dd>
<dt>µs, us, microsecond:</dt>
<dd>One millionth of a second, also one thousandth of a millisecond,
=====================================
ntpwait/ntpwait
=====================================
--- a/ntpwait/ntpwait
+++ b/ntpwait/ntpwait
@@ -124,7 +124,6 @@ if __name__ == "__main__":
tries = 100
sleep = 6
verbose = 0
- help = False
for (switch, val) in options:
if switch in ("-n", "--tries"):
tries = int(val)
=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -276,7 +276,7 @@ class ntpq_session:
self.name = canonname or hname
self.isnum = False
if self.debug > 2:
- sys.stdout.write("Opening host %s\n" % temphost)
+ sys.stdout.write("Opening host %s\n" % self.name)
self.port = sockaddr[1]
try:
self.sock = socket.socket(family, socktype, protocol)
@@ -367,7 +367,7 @@ class ntpq_session:
warn("%s: timed out with incomplete data\n" % self.name);
if self.debug:
sys.stderr.write("ERR_INCOMPLETE: Received fragments:\n")
- for (i, frag) in enumerae(fragments):
+ for (i, frag) in enumerate(fragments):
sys.stderr.write("%d: %s" % (i+1, frag.stats()))
sys.stderr.write("last fragment %sreceived\n",
("not " "", )[seenlastfrag])
@@ -389,7 +389,7 @@ class ntpq_session:
continue
if rpkt.mode() != MODE_CONTROL:
if self.debug:
- warn("Packet received with mode %d\n" % pkt.mode())
+ warn("Packet received with mode %d\n" % rpkt.mode())
continue
if not rpkt.is_response():
if self.debug:
@@ -448,7 +448,7 @@ class ntpq_session:
if len(fragments) > 0:
last = fragments[-1]
- if last.end() > rkpt.offset:
+ if last.end() > rpkt.offset:
warn("received frag at %d overlaps with %d octet frag at %d\n" % (rpkt.offset, last.count, last.offset));
continue
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/28ac88eb263ab4a56e641c14101b6b1223f803ea...b8d31290f20309adaf31dc78a92abde02116c931
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160907/6c539d78/attachment.html>
More information about the vc
mailing list