Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
NTPsec
ntpsec
Compare Revisions
3c109673dfbc730b926d536dffc0f58f92513041...a67785d989057a88f3213326db1f43816a923672
Commits (3)
Add another syscall to the allowed list
· ed8c9d20
Hal Murray
authored
Nov 24, 2016
ed8c9d20
Few more REFIDLEN fixes
· d2c6e4ca
Hal Murray
authored
Nov 25, 2016
d2c6e4ca
Fix typo: missing f in lfptoloat
· a67785d9
Hal Murray
authored
Nov 30, 2016
a67785d9
Hide whitespace changes
Inline
Side-by-side
ntpd/ntp_proto.c
View file @
a67785d9
...
...
@@ -246,7 +246,7 @@ parse_packet(
pkt
->
precision
=
(
int8_t
)
recv_buf
[
3
];
pkt
->
rootdelay
=
ntp_be32dec
(
recv_buf
+
4
);
pkt
->
rootdisp
=
ntp_be32dec
(
recv_buf
+
8
);
memcpy
(
pkt
->
refid
,
recv_buf
+
12
,
4
);
memcpy
(
pkt
->
refid
,
recv_buf
+
12
,
REFIDLEN
);
pkt
->
reftime
=
ntp_be64dec
(
recv_buf
+
16
);
pkt
->
org
=
ntp_be64dec
(
recv_buf
+
24
);
pkt
->
rec
=
ntp_be64dec
(
recv_buf
+
32
);
...
...
@@ -552,7 +552,7 @@ handle_procpkt(
peer
->
outcount
=
0
;
if
(
is_kod
(
pkt
))
{
if
(
!
memcmp
(
pkt
->
refid
,
"RATE"
,
4
))
{
if
(
!
memcmp
(
pkt
->
refid
,
"RATE"
,
REFIDLEN
))
{
peer
->
selbroken
++
;
report_event
(
PEVNT_RATE
,
peer
,
NULL
);
if
(
peer
->
minpoll
<
10
)
{
peer
->
minpoll
=
10
;
}
...
...
@@ -622,7 +622,7 @@ handle_procpkt(
peer
->
precision
=
pkt
->
precision
;
peer
->
rootdelay
=
scalbn
((
double
)
pkt
->
rootdelay
,
-
16
);
peer
->
rootdisp
=
scalbn
((
double
)
pkt
->
rootdisp
,
-
16
);
memcpy
(
&
peer
->
refid
,
pkt
->
refid
,
4
);
memcpy
(
&
peer
->
refid
,
pkt
->
refid
,
REFIDLEN
);
uint64_to_lfp
(
&
peer
->
reftime
,
pkt
->
reftime
);
uint64_to_lfp
(
&
peer
->
rec
,
pkt
->
rec
);
uint64_to_lfp
(
&
peer
->
xmt
,
pkt
->
xmt
);
...
...
ntpd/ntp_sandbox.c
View file @
a67785d9
...
...
@@ -342,6 +342,7 @@ int scmp_sc[] = {
SCMP_SYS
(
socket
),
SCMP_SYS
(
socketcall
),
/* old kernels */
SCMP_SYS
(
stat
),
SCMP_SYS
(
statfs64
),
/* from getaddrinfo after lid open */
#ifdef __NR_time
SCMP_SYS
(
time
),
/* not in ARM */
#endif
...
...
pylib/packet.py
View file @
a67785d9
...
...
@@ -1305,7 +1305,7 @@ class ControlSession:
highwater
=
len
(
span
.
entries
)
for
(
tag
,
val
)
in
variables
.
items
():
if
tag
==
"now"
:
span
.
now
=
ntp
.
ntpc
.
lfptoloat
(
val
)
span
.
now
=
ntp
.
ntpc
.
lfpto
f
loat
(
val
)
continue
elif
tag
==
"last.newest"
:
continue
...
...
@@ -1319,7 +1319,7 @@ class ControlSession:
if
idx
>=
len
(
span
.
entries
):
span
.
entries
.
append
(
MRUEntry
())
if
type
(
val
)
!=
type
(
0
)
and
val
.
startswith
(
"0x"
):
val
=
ntp
.
ntpc
.
lfptoloat
(
val
)
val
=
ntp
.
ntpc
.
lfpto
f
loat
(
val
)
setattr
(
span
.
entries
[
-
1
],
prefix
,
val
)
# If we've seen the end sentinel on the span, break out
...
...