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
cd3e4c61
Commit
cd3e4c61
authored
Mar 23, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We no longer use "anon" ACL's to compare VCL_IP
parent
3514c817
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
35 deletions
+30
-35
vcc_acl.c
lib/libvcc/vcc_acl.c
+30
-35
No files found.
lib/libvcc/vcc_acl.c
View file @
cd3e4c61
...
...
@@ -422,7 +422,7 @@ vcc_acl_entry(struct vcc *tl)
*/
static
void
vcc_acl_emit
(
struct
vcc
*
tl
,
const
char
*
name
,
const
char
*
rname
,
int
anon
)
vcc_acl_emit
(
struct
vcc
*
tl
,
const
char
*
name
,
const
char
*
rname
)
{
struct
acl_e
*
ae
;
int
depth
,
l
,
m
,
i
;
...
...
@@ -433,7 +433,7 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon)
func
=
VSB_new_auto
();
AN
(
func
);
VSB_printf
(
func
,
"match_acl_
%s_"
,
anon
?
"anon"
:
"named
"
);
VSB_printf
(
func
,
"match_acl_"
);
VCC_PrintCName
(
func
,
name
,
NULL
);
AZ
(
VSB_finish
(
func
));
...
...
@@ -448,7 +448,7 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon)
Fh
(
tl
,
0
,
"
\t\t
VPI_acl_log(ctx,
\"
NO_FAM %s
\"
);
\n
"
,
name
);
Fh
(
tl
,
0
,
"
\t\t
return(0);
\n
"
);
Fh
(
tl
,
0
,
"
\t
}
\n\n
"
);
if
(
!
tl
->
err_unref
&&
!
anon
)
{
if
(
!
tl
->
err_unref
)
{
ifp
=
New_IniFin
(
tl
);
VSB_printf
(
ifp
->
ini
,
"
\t
if (0) %s(0, 0);
\n
"
,
VSB_data
(
func
));
...
...
@@ -498,7 +498,6 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon)
i
=
((
int
)
ae
->
mask
+
7
)
/
8
;
if
(
!
anon
)
{
Fh
(
tl
,
0
,
"
\t
%*sVPI_acl_log(ctx,
\"
%sMATCH %s
\"
"
,
-
i
,
""
,
ae
->
not
?
"NEG_"
:
""
,
name
);
t
=
ae
->
t_addr
;
...
...
@@ -518,7 +517,6 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon)
Fh
(
tl
,
0
,
"
\"
fixed: %s
\"
"
,
ae
->
fixed
);
Fh
(
tl
,
0
,
");
\n
"
);
}
Fh
(
tl
,
0
,
"
\t
%*sreturn (%d);
\n
"
,
-
i
,
""
,
ae
->
not
?
0
:
1
);
}
...
...
@@ -528,18 +526,15 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon)
Fh
(
tl
,
0
,
"
\t
%*.*s}
\n
"
,
depth
,
depth
,
""
);
/* Deny by default */
if
(
!
anon
)
Fh
(
tl
,
0
,
"
\t
VPI_acl_log(ctx,
\"
NO_MATCH %s
\"
);
\n
"
,
name
);
Fh
(
tl
,
0
,
"
\t
return (0);
\n
}
\n
"
);
if
(
!
anon
)
{
/* Emit the struct that will be referenced */
Fh
(
tl
,
0
,
"
\n
const struct vrt_acl %s[] = {{
\n
"
,
rname
);
Fh
(
tl
,
0
,
"
\t
.magic = VRT_ACL_MAGIC,
\n
"
);
Fh
(
tl
,
0
,
"
\t
.match = &%s,
\n
"
,
VSB_data
(
func
));
Fh
(
tl
,
0
,
"
\t
.name =
\"
%s
\"
,
\n
"
,
name
);
Fh
(
tl
,
0
,
"}};
\n\n
"
);
}
VSB_destroy
(
&
func
);
}
...
...
@@ -566,5 +561,5 @@ vcc_ParseAcl(struct vcc *tl)
}
SkipToken
(
tl
,
'}'
);
vcc_acl_emit
(
tl
,
sym
->
name
,
sym
->
rname
,
0
);
vcc_acl_emit
(
tl
,
sym
->
name
,
sym
->
rname
);
}
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