[master] 5bd17b74b Change acl::NO_FAM (which should never happen) from a VSL record to VRT_Fail

Poul-Henning Kamp phk at FreeBSD.org
Tue May 4 12:05:07 UTC 2021


commit 5bd17b74b2b09ee074a9fdd3882feaeb958e45aa
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue May 4 11:35:30 2021 +0000

    Change acl::NO_FAM (which should never happen) from a VSL record to VRT_Fail

diff --git a/include/tbl/vsl_tags.h b/include/tbl/vsl_tags.h
index 94ed41409..2d3d3cf86 100644
--- a/include/tbl/vsl_tags.h
+++ b/include/tbl/vsl_tags.h
@@ -289,16 +289,15 @@ SLTM(Fetch_Body, 0, "Body fetched from backend",
 SLTM(VCL_acl, 0, "VCL ACL check results",
 	"ACLs with the `+log` flag emits this record with the result.\n\n"
 	"The format is::\n\n"
-	"\t%s [%s [%s [fixed: %s]]]\n"
-	"\t|   |   |          |\n"
-	"\t|   |   |          +- Fixed entry (see vcc_acl_pedantic parameter)\n"
-	"\t|   |   +------------ Matching entry (only for MATCH)\n"
-	"\t|   +---------------- Name of the ACL for MATCH or NO_MATCH\n"
-	"\t+-------------------- MATCH, NO_MATCH or NO_FAM\n"
+	"\t%s %s [%s [fixed: %s]]\n"
+	"\t|  |   |          |\n"
+	"\t|  |   |          +- Fixed entry (see vcc_acl_pedantic parameter)\n"
+	"\t|  |   +------------ Matching entry (only for MATCH)\n"
+	"\t|  +---------------- Name of the ACL\n"
+	"\t+-------------------- MATCH or NO_MATCH\n"
 	"\n"
 	"MATCH denotes an ACL match\n"
 	"NO_MATCH denotes that a checked ACL has not matched\n"
-	"NO_FAM denotes a missing address family and should not occur.\n"
 	"\n"
 )
 
diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c
index f4a53a5aa..6f455ad5a 100644
--- a/lib/libvcc/vcc_acl.c
+++ b/lib/libvcc/vcc_acl.c
@@ -586,8 +586,8 @@ vcc_acl_emit(struct vcc *tl, const struct symbol *sym)
 	Fh(tl, 0, "\n");
 	Fh(tl, 0, "\tfam = VRT_VSA_GetPtr(ctx, p, &a);\n");
 	Fh(tl, 0, "\tif (fam < 0) {\n");
-	if (tl->acl->flag_log)
-		Fh(tl, 0, "\t\tVPI_acl_log(ctx, \"NO_FAM %s\");\n", sym->name);
+	Fh(tl, 0, "\t\tVRT_fail(ctx,");
+	Fh(tl, 0, " \"ACL %s: no protocol family\");\n", sym->name);
 	Fh(tl, 0, "\t\treturn(0);\n");
 	Fh(tl, 0, "\t}\n\n");
 	if (!tl->err_unref) {


More information about the varnish-commit mailing list