[3.0] 87357ee Better fix for #1126
Tollef Fog Heen
tfheen at varnish-cache.org
Thu May 24 14:51:11 CEST 2012
commit 87357eee9c5df596825ee3e0380d2c64b71de142
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Apr 16 07:22:57 2012 +0000
Better fix for #1126
diff --git a/lib/libvcl/vcc_acl.c b/lib/libvcl/vcc_acl.c
index 272f3c6..3e5ac6c 100644
--- a/lib/libvcl/vcc_acl.c
+++ b/lib/libvcl/vcc_acl.c
@@ -103,7 +103,10 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l,
if (fam == PF_INET && ae->mask > 32) {
VSB_printf(tl->sb,
"Too wide mask (%u) for IPv4 address", ae->mask);
- vcc_ErrWhere(tl, ae->t_mask);
+ if (ae->t_mask != NULL)
+ vcc_ErrWhere(tl, ae->t_mask);
+ else
+ vcc_ErrWhere(tl, ae->t_addr);
return;
}
if (fam == PF_INET6 && ae->mask > 128) {
@@ -265,10 +268,8 @@ vcc_acl_try_netnotation(struct vcc *tl, struct acl_e *ae)
return (0);
p += k + 1;
}
- if (ae->t_mask == NULL) {
+ if (ae->t_mask == NULL)
ae->mask = 8 + 8 * i;
- ae->t_mask = ae->t_addr;
- }
vcc_acl_add_entry(tl, ae, 4, b, AF_INET);
return (1);
}
More information about the varnish-commit
mailing list