Commit f74235ab authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Signed/unsigned polish

parent 94414c2a
varnishtest "VCL compiler coverage test: vcc_acl.c" varnishtest "VCL compiler coverage test: vcc_acl.c"
varnish v1 -errvcl {Too wide mask (33) for IPv4 address} { varnish v1 -errvcl {Too wide mask (/33) for IPv4 address} {
backend b { .host = "127.0.0.1"; } backend b { .host = "127.0.0.1"; }
acl a { "10.1.2.3"/33; } acl a { "10.1.2.3"/33; }
sub vcl_recv { if (client.ip ~ a) { return(pass); } } sub vcl_recv { if (client.ip ~ a) { return(pass); } }
} }
varnish v1 -errvcl {Too wide mask (129) for IPv6 address} { varnish v1 -errvcl {Too wide mask (/129) for IPv6 address} {
backend b { .host = "127.0.0.1"; } backend b { .host = "127.0.0.1"; }
acl a { "1::2"/129; } acl a { "1::2"/129; }
sub vcl_recv { if (client.ip ~ a) { return(pass); } } sub vcl_recv { if (client.ip ~ a) { return(pass); } }
......
...@@ -99,7 +99,7 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l, ...@@ -99,7 +99,7 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l,
if (fam == PF_INET && ae->mask > 32) { if (fam == PF_INET && ae->mask > 32) {
VSB_printf(tl->sb, VSB_printf(tl->sb,
"Too wide mask (%u) for IPv4 address\n", ae->mask); "Too wide mask (/%d) for IPv4 address\n", ae->mask);
if (ae->t_mask != NULL) if (ae->t_mask != NULL)
vcc_ErrWhere(tl, ae->t_mask); vcc_ErrWhere(tl, ae->t_mask);
else else
...@@ -108,7 +108,7 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l, ...@@ -108,7 +108,7 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l,
} }
if (fam == PF_INET6 && ae->mask > 128) { if (fam == PF_INET6 && ae->mask > 128) {
VSB_printf(tl->sb, VSB_printf(tl->sb,
"Too wide mask (%u) for IPv6 address\n", ae->mask); "Too wide mask (/%d) for IPv6 address\n", ae->mask);
vcc_ErrWhere(tl, ae->t_mask); vcc_ErrWhere(tl, ae->t_mask);
return; return;
} }
...@@ -231,7 +231,7 @@ vcc_acl_try_getaddrinfo(struct vcc *tl, struct acl_e *ae) ...@@ -231,7 +231,7 @@ vcc_acl_try_getaddrinfo(struct vcc *tl, struct acl_e *ae)
if (ae->t_mask != NULL && i4 > 0 && i6 > 0) { if (ae->t_mask != NULL && i4 > 0 && i6 > 0) {
VSB_printf(tl->sb, VSB_printf(tl->sb,
"Mask (%u) specified, but string resolves to" "Mask (/%d) specified, but string resolves to"
" both IPv4 and IPv6 addresses.\n", ae->mask); " both IPv4 and IPv6 addresses.\n", ae->mask);
vcc_ErrWhere(tl, ae->t_mask); vcc_ErrWhere(tl, ae->t_mask);
return; return;
......
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