Clean up the mgt->vcc interface for vcc_acl_pedantic

Spotted by flexelint

Ref: 6c8f25e7
parent 03463abf
...@@ -68,6 +68,7 @@ const char *mgt_vmod_path; ...@@ -68,6 +68,7 @@ const char *mgt_vmod_path;
unsigned mgt_vcc_err_unref; unsigned mgt_vcc_err_unref;
unsigned mgt_vcc_allow_inline_c; unsigned mgt_vcc_allow_inline_c;
unsigned mgt_vcc_unsafe_path; unsigned mgt_vcc_unsafe_path;
unsigned mgt_vcc_acl_pedantic;
#define VGC_SRC "vgc.c" #define VGC_SRC "vgc.c"
...@@ -109,6 +110,7 @@ run_vcc(void *priv) ...@@ -109,6 +110,7 @@ run_vcc(void *priv)
VCC_Err_Unref(vcc, mgt_vcc_err_unref); VCC_Err_Unref(vcc, mgt_vcc_err_unref);
VCC_Allow_InlineC(vcc, mgt_vcc_allow_inline_c); VCC_Allow_InlineC(vcc, mgt_vcc_allow_inline_c);
VCC_Unsafe_Path(vcc, mgt_vcc_unsafe_path); VCC_Unsafe_Path(vcc, mgt_vcc_unsafe_path);
VCC_Acl_Pedantic(vcc, mgt_vcc_acl_pedantic);
STV_Foreach(stv) STV_Foreach(stv)
VCC_Predef(vcc, "VCL_STEVEDORE", stv->ident); VCC_Predef(vcc, "VCL_STEVEDORE", stv->ident);
VTAILQ_FOREACH(vpg, &vclhead, list) VTAILQ_FOREACH(vpg, &vclhead, list)
......
...@@ -37,6 +37,7 @@ void VCC_Allow_InlineC(struct vcc *, unsigned); ...@@ -37,6 +37,7 @@ void VCC_Allow_InlineC(struct vcc *, unsigned);
void VCC_Builtin_VCL(struct vcc *, const char *); void VCC_Builtin_VCL(struct vcc *, const char *);
void VCC_Err_Unref(struct vcc *, unsigned); void VCC_Err_Unref(struct vcc *, unsigned);
void VCC_Unsafe_Path(struct vcc *, unsigned); void VCC_Unsafe_Path(struct vcc *, unsigned);
void VCC_Acl_Pedantic(struct vcc *, unsigned);
void VCC_VCL_path(struct vcc *, const char *); void VCC_VCL_path(struct vcc *, const char *);
void VCC_VMOD_path(struct vcc *, const char *); void VCC_VMOD_path(struct vcc *, const char *);
void VCC_Predef(struct vcc *, const char *type, const char *name); void VCC_Predef(struct vcc *, const char *type, const char *name);
......
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
#include <vtcp.h> #include <vtcp.h>
#include <vsa.h> #include <vsa.h>
unsigned mgt_vcc_acl_pedantic;
#define ACL_MAXADDR (sizeof(struct in6_addr) + 1) #define ACL_MAXADDR (sizeof(struct in6_addr) + 1)
struct acl_e { struct acl_e {
...@@ -140,12 +138,12 @@ vcc_acl_chk(struct vcc *tl, const struct acl_e *ae, const int l, ...@@ -140,12 +138,12 @@ vcc_acl_chk(struct vcc *tl, const struct acl_e *ae, const int l,
AN(sa); AN(sa);
VTCP_name(sa, h, sizeof h, NULL, 0); VTCP_name(sa, h, sizeof h, NULL, 0);
bprintf(t, "%s/%d", h, ae->mask); bprintf(t, "%s/%d", h, ae->mask);
if (mgt_vcc_acl_pedantic) if (tl->acl_pedantic != 0)
VSB_printf(tl->sb, "Address/Netmask mismatch, need be %s\n", t); VSB_printf(tl->sb, "Address/Netmask mismatch, need be %s\n", t);
else else
VSB_printf(tl->sb, "Address/Netmask mismatch, changed to %s\n", t); VSB_printf(tl->sb, "Address/Netmask mismatch, changed to %s\n", t);
vcc_ErrWhere(tl, ae->t_addr); vcc_ErrWhere(tl, ae->t_addr);
if (mgt_vcc_acl_pedantic == 0) if (tl->acl_pedantic == 0)
vcc_Warn(tl); vcc_Warn(tl);
return (strdup(t)); return (strdup(t));
} }
......
...@@ -913,6 +913,14 @@ VCC_Unsafe_Path(struct vcc *vcc, unsigned u) ...@@ -913,6 +913,14 @@ VCC_Unsafe_Path(struct vcc *vcc, unsigned u)
vcc->unsafe_path = u; vcc->unsafe_path = u;
} }
void
VCC_Acl_Pedantic(struct vcc *vcc, unsigned u)
{
CHECK_OBJ_NOTNULL(vcc, VCC_MAGIC);
vcc->acl_pedantic = u;
}
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
* Configure settings * Configure settings
*/ */
......
...@@ -222,6 +222,7 @@ struct vcc { ...@@ -222,6 +222,7 @@ struct vcc {
unsigned err_unref; unsigned err_unref;
unsigned allow_inline_c; unsigned allow_inline_c;
unsigned unsafe_path; unsigned unsafe_path;
unsigned acl_pedantic;
struct symtab *syms; struct symtab *syms;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment