瀏覽代碼

check_ping: Fixing "time of day goes back"
by Geoff Oakham <goakham at oanda.com>

Patch of check_ping that allows it to gracefully handle when ping outputs
to stderr "Warning: time of day goes back (-XXXXus), taking countermeasures."

Closes: #809 and #1195

Jan Wagner 12 年之前
父節點
當前提交
455fe96e7d
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 1 0
      THANKS.in
  2. 5 1
      plugins/check_ping.c

+ 1 - 0
THANKS.in

@@ -301,4 +301,5 @@ Pall Sigurdsson
 Sebastian Schmidt
 Simon Kainz
 Steve Weinreich
+Geoff Oakham
 Tim Laszlo

+ 5 - 1
plugins/check_ping.c

@@ -482,7 +482,11 @@ run_ping (const char *cmd, const char *addr)
 	/* check stderr, setting at least WARNING if there is output here */
 	/* Add warning into warn_text */
 	while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr)) {
-		if (! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP")) {
+		if (
+			! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP")
+			&& ! strstr(buf,"Warning: time of day goes back")
+
+		) {
 			if (verbose >= 3) {
 				printf("Got stderr: %s", buf);
 			}