[experimental-ims] 8bc9a68 Better fix for #1126

Poul-Henning Kamp phk at FreeBSD.org
Thu Dec 18 10:27:43 CET 2014


commit 8bc9a68068584feaab4442569f5d815ba609b925
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 b42f9de..9535f59 100644
--- a/lib/libvcl/vcc_acl.c
+++ b/lib/libvcl/vcc_acl.c
@@ -101,7 +101,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) {
@@ -263,10 +266,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