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
Commits
e32e3d0a
Commit
e32e3d0a
authored
Aug 18, 2017
by
Eric S. Raymond
Browse files
Too many members named 'count'. Distinguish one. No logic changes.
parent
d22a11af
Pipeline
#10978663
passed with stages
in 12 minutes and 2 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/ntp.h
View file @
e32e3d0a
...
...
@@ -654,7 +654,7 @@ typedef struct res_addr6_tag {
typedef
struct
restrict_u_tag
restrict_u
;
struct
restrict_u_tag
{
restrict_u
*
link
;
/* link to next entry */
uint32_t
count
;
/* number of packets matched */
uint32_t
hit
count
;
/* number of packets matched */
unsigned
short
flags
;
/* accesslist flags */
unsigned
short
mflags
;
/* match flags */
unsigned
long
expire
;
/* valid until time */
...
...
ntpd/ntp_control.c
View file @
e32e3d0a
...
...
@@ -3874,7 +3874,7 @@ send_restrict_entry(
case
2
:
snprintf
(
tag
,
sizeof
(
tag
),
hits_fmt
,
idx
);
ctl_putuint
(
tag
,
pres
->
count
);
ctl_putuint
(
tag
,
pres
->
hit
count
);
break
;
case
3
:
...
...
ntpd/ntp_restrict.c
View file @
e32e3d0a
...
...
@@ -433,7 +433,7 @@ restrictions(
match
=
match_restrict4_addr
(
SRCADR
(
srcadr
),
SRCPORT
(
srcadr
));
match
->
count
++
;
match
->
hit
count
++
;
/*
* res_not_found counts only use of the final default
* entry, not any "restrict default ntpport ...", which
...
...
@@ -459,7 +459,7 @@ restrictions(
return
(
int
)
RES_IGNORE
;
match
=
match_restrict6_addr
(
pin6
,
SRCPORT
(
srcadr
));
match
->
count
++
;
match
->
hit
count
++
;
if
(
&
restrict_def6
==
match
)
res_not_found
++
;
else
...
...
tests/ntpd/restrict.c
View file @
e32e3d0a
...
...
@@ -63,14 +63,14 @@ TEST(hackrestrict, RestrictionsAreEmptyAfterInit) {
memset
(
rl4
,
0
,
sizeof
(
restrict_u
));
memset
(
rl6
,
0
,
sizeof
(
restrict_u
));
TEST_ASSERT_EQUAL
(
rl4
->
count
,
restrictlist4
->
count
);
TEST_ASSERT_EQUAL
(
rl4
->
hit
count
,
restrictlist4
->
hit
count
);
TEST_ASSERT_EQUAL
(
rl4
->
flags
,
restrictlist4
->
flags
);
TEST_ASSERT_EQUAL
(
rl4
->
mflags
,
restrictlist4
->
mflags
);
TEST_ASSERT_EQUAL
(
rl4
->
expire
,
restrictlist4
->
expire
);
TEST_ASSERT_EQUAL
(
rl4
->
u
.
v4
.
addr
,
restrictlist4
->
u
.
v4
.
addr
);
TEST_ASSERT_EQUAL
(
rl4
->
u
.
v4
.
mask
,
restrictlist4
->
u
.
v4
.
mask
);
TEST_ASSERT_EQUAL
(
rl6
->
count
,
restrictlist6
->
count
);
TEST_ASSERT_EQUAL
(
rl6
->
hit
count
,
restrictlist6
->
hit
count
);
TEST_ASSERT_EQUAL
(
rl6
->
flags
,
restrictlist6
->
flags
);
TEST_ASSERT_EQUAL
(
rl6
->
mflags
,
restrictlist6
->
mflags
);
TEST_ASSERT_EQUAL
(
rl6
->
expire
,
restrictlist6
->
expire
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment