summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/sntp/main.c
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2015-05-04 04:45:59 +0000
committercy <cy@FreeBSD.org>2015-05-04 04:45:59 +0000
commit1818eba70c74c4ba7173ef82fd98d197914adc74 (patch)
tree62ff96a32b854c652d9d65280d1d6fd2089b2f1e /contrib/ntp/sntp/main.c
parent46cb5cb412522de16502b815c1126a1bf652045b (diff)
parentf63afe28012870b3eb07e80844160966b32ef52e (diff)
downloadFreeBSD-src-1818eba70c74c4ba7173ef82fd98d197914adc74.zip
FreeBSD-src-1818eba70c74c4ba7173ef82fd98d197914adc74.tar.gz
MFV ntp 4.2.8p2 (r281348)
Reviewed by: delphij (suggested MFC) Approved by: roberto Security: CVE-2015-1798, CVE-2015-1799 Security: VuXML ebd84c96-dd7e-11e4-854e-3c970e169bc2 MFC after: 1 month
Diffstat (limited to 'contrib/ntp/sntp/main.c')
-rw-r--r--contrib/ntp/sntp/main.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/contrib/ntp/sntp/main.c b/contrib/ntp/sntp/main.c
index c271c8c..20e27f0 100644
--- a/contrib/ntp/sntp/main.c
+++ b/contrib/ntp/sntp/main.c
@@ -1161,6 +1161,7 @@ handle_pkt(
int stratum;
char * ref;
char * ts_str;
+ char * leaptxt;
double offset;
double precision;
double synch_distance;
@@ -1256,9 +1257,28 @@ handle_pkt(
disptxt[0] = '\0';
}
- msyslog(LOG_INFO, "%s %+.*f%s %s s%d%s", ts_str,
+ switch (PKT_LEAP(rpkt->li_vn_mode)) {
+ case LEAP_NOWARNING:
+ leaptxt = "no-leap";
+ break;
+ case LEAP_ADDSECOND:
+ leaptxt = "add-leap";
+ break;
+ case LEAP_DELSECOND:
+ leaptxt = "del-leap";
+ break;
+ case LEAP_NOTINSYNC:
+ leaptxt = "unsync";
+ break;
+ default:
+ leaptxt = "LEAP-ERROR";
+ break;
+ }
+
+ msyslog(LOG_INFO, "%s %+.*f%s %s s%d %s%s", ts_str,
digits, offset, disptxt,
hostnameaddr(hostname, host), stratum,
+ leaptxt,
(time_adjusted)
? " [excess]"
: "");
OpenPOWER on IntegriCloud