Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
d89674d1
Commit
d89674d1
authored
Apr 12, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collapse vcc_acl_add_entry() and vcc_acl_insert_entry()
parent
1e45d97c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
23 deletions
+10
-23
flint.lnt
lib/libvcc/flint.lnt
+1
-0
vcc_acl.c
lib/libvcc/vcc_acl.c
+9
-23
No files found.
lib/libvcc/flint.lnt
View file @
d89674d1
...
...
@@ -4,6 +4,7 @@
-sem(vcc_new_source, custodial(1))
-sem(acl_tree_VRBT_INSERT, custodial(2))
-emacro(835, EXPR_VAR) // Info 835: A zero has been given as right argument to operator '<<'
-esym(755, VCL_40) // Not used (right now)
...
...
lib/libvcc/vcc_acl.c
View file @
d89674d1
...
...
@@ -181,30 +181,11 @@ vcc_acl_chk(struct vcc *tl, const struct acl_e *ae, const int l,
return
(
strdup
(
t
));
}
static
void
vcc_acl_insert_entry
(
struct
vcc
*
tl
,
struct
acl_e
**
aenp
)
{
struct
acl_e
*
ae2
;
CHECK_OBJ_NOTNULL
(
*
aenp
,
VCC_ACL_E_MAGIC
);
ae2
=
VRBT_INSERT
(
acl_tree
,
&
tl
->
acl
->
acl_tree
,
*
aenp
);
if
(
ae2
!=
NULL
)
{
if
(
ae2
->
not
!=
(
*
aenp
)
->
not
)
{
VSB_cat
(
tl
->
sb
,
"Conflicting ACL entries:
\n
"
);
vcc_ErrWhere
(
tl
,
ae2
->
t_addr
);
VSB_cat
(
tl
->
sb
,
"vs:
\n
"
);
vcc_ErrWhere
(
tl
,
(
*
aenp
)
->
t_addr
);
}
return
;
}
*
aenp
=
NULL
;
}
static
void
vcc_acl_add_entry
(
struct
vcc
*
tl
,
const
struct
acl_e
*
ae
,
int
l
,
unsigned
char
*
u
,
int
fam
)
{
struct
acl_e
*
aen
;
struct
acl_e
*
aen
,
*
ae2
;
if
(
fam
==
PF_INET
&&
ae
->
mask
>
32
)
{
VSB_printf
(
tl
->
sb
,
...
...
@@ -239,9 +220,14 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l,
assert
(
l
+
1UL
<=
sizeof
aen
->
data
);
memcpy
(
aen
->
data
+
1L
,
u
,
l
);
vcc_acl_insert_entry
(
tl
,
&
aen
);
if
(
aen
!=
NULL
)
ae2
=
VRBT_INSERT
(
acl_tree
,
&
tl
->
acl
->
acl_tree
,
aen
);
if
(
ae2
!=
NULL
&&
ae2
->
not
!=
aen
->
not
)
{
VSB_cat
(
tl
->
sb
,
"Conflicting ACL entries:
\n
"
);
vcc_ErrWhere
(
tl
,
ae2
->
t_addr
);
VSB_cat
(
tl
->
sb
,
"vs:
\n
"
);
vcc_ErrWhere
(
tl
,
aen
->
t_addr
);
vcl_acl_free
(
&
aen
);
}
}
static
void
...
...
@@ -599,7 +585,7 @@ vcc_ParseAcl(struct vcc *tl)
ERRCHK
(
tl
);
AN
(
sym
);
while
(
tl
->
t
->
tok
==
'-'
||
tl
->
t
->
tok
==
'+'
)
{
while
(
tl
->
t
->
tok
==
'-'
||
tl
->
t
->
tok
==
'+'
)
{
sign
=
tl
->
t
;
vcc_NextToken
(
tl
);
if
(
tl
->
t
->
b
!=
sign
->
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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