[Git][NTPsec/ntpsec][master] 2 commits: Revert "Refactor: Remove redundant |DEF flagging"
Matt Selsky
gitlab at mg.gitlab.com
Wed Jun 26 04:27:09 UTC 2019
Matt Selsky pushed to branch master at NTPsec / ntpsec
Commits:
b1804c4b by Richard Laager at 2019-06-26T04:20:59Z
Revert "Refactor: Remove redundant |DEF flagging"
This reverts commit 4c5a32fb16603e05218ef5b09d29709f5ec61f90.
- - - - -
3b23756a by Richard Laager at 2019-06-26T04:20:59Z
Revert "Feature: Send all mode six data. Don't filter it."
This reverts commit ee4ce10810d5a5f8b4bb9b25202b2baa8845868f.
As mentioned on devel@ and in !963, this changes the system variables
output from `ntpq -c rv 0`.
- - - - -
1 changed file:
- ntpd/ntp_control.c
Changes:
=====================================
ntpd/ntp_control.c
=====================================
@@ -128,51 +128,51 @@ static const struct ctl_proc control_codes[] = {
static const struct ctl_var sys_var[] = {
{ 0, PADDING, "" },
#define CS_LEAP 1
- { CS_LEAP, RW, "leap" },
+ { CS_LEAP, RW|DEF, "leap" },
#define CS_STRATUM 2
- { CS_STRATUM, RO, "stratum" },
+ { CS_STRATUM, RO|DEF, "stratum" },
#define CS_PRECISION 3
- { CS_PRECISION, RO, "precision" },
+ { CS_PRECISION, RO|DEF, "precision" },
#define CS_ROOTDELAY 4
- { CS_ROOTDELAY, RO, "rootdelay" },
+ { CS_ROOTDELAY, RO|DEF, "rootdelay" },
#define CS_ROOTDISPERSION 5
- { CS_ROOTDISPERSION, RO, "rootdisp" },
+ { CS_ROOTDISPERSION, RO|DEF, "rootdisp" },
#define CS_REFID 6
- { CS_REFID, RO, "refid" },
+ { CS_REFID, RO|DEF, "refid" },
#define CS_REFTIME 7
- { CS_REFTIME, RO, "reftime" },
+ { CS_REFTIME, RO|DEF, "reftime" },
#define CS_POLL 8
- { CS_POLL, RO, "tc" },
+ { CS_POLL, RO|DEF, "tc" },
#define CS_PEERID 9
- { CS_PEERID, RO, "peer" },
+ { CS_PEERID, RO|DEF, "peer" },
#define CS_OFFSET 10
- { CS_OFFSET, RO, "offset" },
+ { CS_OFFSET, RO|DEF, "offset" },
#define CS_DRIFT 11
- { CS_DRIFT, RO, "frequency" },
+ { CS_DRIFT, RO|DEF, "frequency" },
#define CS_JITTER 12
- { CS_JITTER, RO, "sys_jitter" },
+ { CS_JITTER, RO|DEF, "sys_jitter" },
#define CS_ERROR 13
- { CS_ERROR, RO, "clk_jitter" },
+ { CS_ERROR, RO|DEF, "clk_jitter" },
#define CS_CLOCK 14
- { CS_CLOCK, RO, "clock" },
+ { CS_CLOCK, RO|DEF, "clock" },
#define CS_PROCESSOR 15
- { CS_PROCESSOR, RO, "processor" },
+ { CS_PROCESSOR, RO|DEF, "processor" },
#define CS_SYSTEM 16
- { CS_SYSTEM, RO, "system" },
+ { CS_SYSTEM, RO|DEF, "system" },
#define CS_VERSION 17
- { CS_VERSION, RO, "version" },
+ { CS_VERSION, RO|DEF, "version" },
#define CS_STABIL 18
- { CS_STABIL, RO, "clk_wander" },
+ { CS_STABIL, RO|DEF, "clk_wander" },
#define CS_VARLIST 19
{ CS_VARLIST, RO, "sys_var_list" },
#define CS_TAI 20
- { CS_TAI, RO, "tai" },
+ { CS_TAI, RO|DEF, "tai" },
#define CS_LEAPTAB 21
- { CS_LEAPTAB, RO, "leapsec" },
+ { CS_LEAPTAB, RO|DEF, "leapsec" },
#define CS_LEAPEND 22
- { CS_LEAPEND, RO, "expire" },
+ { CS_LEAPEND, RO|DEF, "expire" },
#define CS_RATE 23
- { CS_RATE, RO, "mintc" },
+ { CS_RATE, RO|DEF, "mintc" },
#define CS_MRU_ENABLED 24
{ CS_MRU_ENABLED, RO, "mru_enabled" },
#define CS_MRU_DEPTH 25
@@ -319,9 +319,9 @@ static const struct ctl_var sys_var[] = {
{ CS_MRU_OLDEST_AGE, RO, "mru_oldest_age" },
#ifdef ENABLE_LEAP_SMEAR
#define CS_LEAPSMEARINTV 96
- { CS_LEAPSMEARINTV, RO, "leapsmearinterval" },
+ { CS_LEAPSMEARINTV, RO|DEF, "leapsmearinterval" },
#define CS_LEAPSMEAROFFS 97
- { CS_LEAPSMEAROFFS, RO, "leapsmearoffset" },
+ { CS_LEAPSMEAROFFS, RO|DEF, "leapsmearoffset" },
#else
/* hack to keep table aligned */
{ CS_MRU_OLDEST_AGE, RO, "mru_oldest_age" },
@@ -399,81 +399,81 @@ static const struct ctl_var peer_var[] = {
#define CP_AUTHENTIC 3
{ CP_AUTHENTIC, RO, "authentic" },
#define CP_SRCADR 4
- { CP_SRCADR, RO , "srcadr" },
+ { CP_SRCADR, RO|DEF , "srcadr" },
#define CP_SRCPORT 5
- { CP_SRCPORT, RO, "srcport" },
+ { CP_SRCPORT, RO|DEF, "srcport" },
#define CP_DSTADR 6
- { CP_DSTADR, RO, "dstadr" },
+ { CP_DSTADR, RO|DEF, "dstadr" },
#define CP_DSTPORT 7
- { CP_DSTPORT, RO, "dstport" },
+ { CP_DSTPORT, RO|DEF, "dstport" },
#define CP_LEAP 8
- { CP_LEAP, RO, "leap" },
+ { CP_LEAP, RO|DEF, "leap" },
#define CP_HMODE 9
- { CP_HMODE, RO, "hmode" },
+ { CP_HMODE, RO|DEF, "hmode" },
#define CP_STRATUM 10
- { CP_STRATUM, RO, "stratum" },
+ { CP_STRATUM, RO|DEF, "stratum" },
#define CP_PPOLL 11
- { CP_PPOLL, RO, "ppoll" },
+ { CP_PPOLL, RO|DEF, "ppoll" },
#define CP_HPOLL 12
- { CP_HPOLL, RO, "hpoll" },
+ { CP_HPOLL, RO|DEF, "hpoll" },
#define CP_PRECISION 13
- { CP_PRECISION, RO, "precision" },
+ { CP_PRECISION, RO|DEF, "precision" },
#define CP_ROOTDELAY 14
- { CP_ROOTDELAY, RO, "rootdelay" },
+ { CP_ROOTDELAY, RO|DEF, "rootdelay" },
#define CP_ROOTDISPERSION 15
- { CP_ROOTDISPERSION, RO, "rootdisp" },
+ { CP_ROOTDISPERSION, RO|DEF, "rootdisp" },
#define CP_REFID 16
- { CP_REFID, RO, "refid" },
+ { CP_REFID, RO|DEF, "refid" },
#define CP_REFTIME 17
- { CP_REFTIME, RO, "reftime" },
+ { CP_REFTIME, RO|DEF, "reftime" },
/* Placeholder. Reporting of "org" is disabled because
leaking it creates a vulnerability */
#define CP_ORG 18
{ CP_ORG, RO, "org" },
#define CP_REC 19
- { CP_REC, RO, "rec" },
+ { CP_REC, RO|DEF, "rec" },
#define CP_XMT 20
- { CP_XMT, RO, "xmt" },
+ { CP_XMT, RO|DEF, "xmt" },
#define CP_REACH 21
- { CP_REACH, RO, "reach" },
+ { CP_REACH, RO|DEF, "reach" },
#define CP_UNREACH 22
- { CP_UNREACH, RO, "unreach" },
+ { CP_UNREACH, RO|DEF, "unreach" },
#define CP_TIMER 23
{ CP_TIMER, RO, "timer" },
#define CP_DELAY 24
- { CP_DELAY, RO, "delay" },
+ { CP_DELAY, RO|DEF, "delay" },
#define CP_OFFSET 25
- { CP_OFFSET, RO, "offset" },
+ { CP_OFFSET, RO|DEF, "offset" },
#define CP_JITTER 26
- { CP_JITTER, RO, "jitter" },
+ { CP_JITTER, RO|DEF, "jitter" },
#define CP_DISPERSION 27
- { CP_DISPERSION, RO, "dispersion" },
+ { CP_DISPERSION, RO|DEF, "dispersion" },
#define CP_KEYID 28
- { CP_KEYID, RO, "keyid" },
+ { CP_KEYID, RO|DEF, "keyid" },
#define CP_FILTDELAY 29
- { CP_FILTDELAY, RO, "filtdelay" },
+ { CP_FILTDELAY, RO|DEF, "filtdelay" },
#define CP_FILTOFFSET 30
- { CP_FILTOFFSET, RO, "filtoffset" },
+ { CP_FILTOFFSET, RO|DEF, "filtoffset" },
#define CP_PMODE 31
- { CP_PMODE, RO, "pmode" },
+ { CP_PMODE, RO|DEF, "pmode" },
#define CP_RECEIVED 32
{ CP_RECEIVED, RO, "received"},
#define CP_SENT 33
{ CP_SENT, RO, "sent" },
#define CP_FILTERROR 34
- { CP_FILTERROR, RO, "filtdisp" },
+ { CP_FILTERROR, RO|DEF, "filtdisp" },
#define CP_FLASH 35
- { CP_FLASH, RO, "flash" },
+ { CP_FLASH, RO|DEF, "flash" },
#define CP_MODE 36
- { CP_MODE, RO, "mode" },
+ { CP_MODE, RO|DEF, "mode" },
#define CP_VARLIST 37
{ CP_VARLIST, RO, "peer_var_list" },
#define CP_RATE 38
- { CP_RATE, RO, "headway" },
+ { CP_RATE, RO|DEF, "headway" },
#define CP_BIAS 39
- { CP_BIAS, RO, "bias" },
+ { CP_BIAS, RO|DEF, "bias" },
#define CP_SRCHOST 40
- { CP_SRCHOST, RO, "srchost" },
+ { CP_SRCHOST, RO|DEF, "srchost" },
#define CP_TIMEREC 41
{ CP_TIMEREC, RO, "timerec" },
#define CP_TIMEREACH 42
@@ -492,7 +492,7 @@ static const struct ctl_var peer_var[] = {
{ CP_CANDIDATE, RO, "candidate" },
/* new in NTPsec */
#define CP_NTSCOOKIES 49
- { CP_NTSCOOKIES, RO, "ntscookies" },
+ { CP_NTSCOOKIES, RO|DEF, "ntscookies" },
#define CP_MAXCODE ((sizeof(peer_var)/sizeof(peer_var[0])) - 1)
{ 0, EOV, "" }
};
@@ -504,29 +504,29 @@ static const struct ctl_var peer_var[] = {
static const struct ctl_var clock_var[] = {
{ 0, PADDING, "" },
#define CC_NAME 1
- { CC_NAME, RO, "name" },
+ { CC_NAME, RO|DEF, "name" },
#define CC_TIMECODE 2
- { CC_TIMECODE, RO, "timecode" },
+ { CC_TIMECODE, RO|DEF, "timecode" },
#define CC_POLL 3
- { CC_POLL, RO, "poll" },
+ { CC_POLL, RO|DEF, "poll" },
#define CC_NOREPLY 4
- { CC_NOREPLY, RO, "noreply" },
+ { CC_NOREPLY, RO|DEF, "noreply" },
#define CC_BADFORMAT 5
- { CC_BADFORMAT, RO, "badformat" },
+ { CC_BADFORMAT, RO|DEF, "badformat" },
#define CC_BADDATA 6
- { CC_BADDATA, RO, "baddata" },
+ { CC_BADDATA, RO|DEF, "baddata" },
#define CC_FUDGETIME1 7
- { CC_FUDGETIME1, RO, "fudgetime1" },
+ { CC_FUDGETIME1, RO|DEF, "fudgetime1" },
#define CC_FUDGETIME2 8
- { CC_FUDGETIME2, RO, "fudgetime2" },
+ { CC_FUDGETIME2, RO|DEF, "fudgetime2" },
#define CC_FUDGEVAL1 9
- { CC_FUDGEVAL1, RO, "stratum" },
+ { CC_FUDGEVAL1, RO|DEF, "stratum" },
#define CC_FUDGEVAL2 10
- { CC_FUDGEVAL2, RO, "refid" },
+ { CC_FUDGEVAL2, RO|DEF, "refid" },
#define CC_FLAGS 11
- { CC_FLAGS, RO, "flags" },
+ { CC_FLAGS, RO|DEF, "flags" },
#define CC_DEVICE 12
- { CC_DEVICE, RO, "device" },
+ { CC_DEVICE, RO|DEF, "device" },
#define CC_VARLIST 13
{ CC_VARLIST, RO, "clock_var_list"},
#define CC_MAXCODE CC_VARLIST
@@ -2678,7 +2678,8 @@ read_status(
* peer. May be more selective later.
*/
for (const struct ctl_var *kv = sys_var; kv && !(EOV & kv->flags); kv++)
- ctl_putpeer(kv->code, peer);
+ if (kv->flags & DEF)
+ ctl_putpeer(kv->code, peer);
ctl_flushpkt(0);
return;
}
@@ -2742,7 +2743,8 @@ read_peervars(void)
ctl_putpeer((int)i, peer);
} else
for (const struct ctl_var *kv = peer_var; kv && !(EOV & kv->flags); kv++)
- ctl_putpeer(kv->code, peer);
+ if (kv->flags & DEF)
+ ctl_putpeer(kv->code, peer);
ctl_flushpkt(0);
}
@@ -2807,10 +2809,12 @@ read_sysvars(void)
}
} else {
for (v = sys_var; v && !(EOV & v->flags); v++)
- ctl_putsys(v->code);
+ if (DEF & v->flags)
+ ctl_putsys(v->code);
for (kv = ext_sys_var; kv && !(EOV & kv->flags); kv++)
- ctl_putdata(kv->text, strlen(kv->text),
- false);
+ if (DEF & kv->flags)
+ ctl_putdata(kv->text, strlen(kv->text),
+ false);
}
free(wants);
ctl_flushpkt(0);
@@ -4130,10 +4134,12 @@ read_clockstatus(
false);
} else {
for (v = clock_var; v != NULL && !(EOV & v->flags); v++)
- ctl_putclock(v->code, &cs, false);
+ if (DEF & v->flags)
+ ctl_putclock(v->code, &cs, false);
for ( ; kv != NULL && !(EOV & kv->flags); kv++)
- ctl_putdata(kv->text, strlen(kv->text),
- false);
+ if (DEF & kv->flags)
+ ctl_putdata(kv->text, strlen(kv->text),
+ false);
}
free(wants);
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/8eecdfb8f2e9f9cd1daa7d5ceca702e674121833...3b23756a75cd8d5889220947bb5605a271926b47
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/8eecdfb8f2e9f9cd1daa7d5ceca702e674121833...3b23756a75cd8d5889220947bb5605a271926b47
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190626/b6e9941c/attachment-0001.htm>
More information about the vc
mailing list