[master] cd55aa7 Make the ban header a multiple of 8 bytes for alignment

Poul-Henning Kamp phk at FreeBSD.org
Sun May 17 18:08:08 CEST 2015


commit cd55aa7f462130406419c38897987778670882dd
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun May 17 15:59:09 2015 +0000

    Make the ban header a multiple of 8 bytes for alignment

diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index 84f8aab..e3e65f3 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -80,7 +80,7 @@
 #define BANS_TIMESTAMP		0
 #define BANS_LENGTH		8
 #define BANS_FLAGS		12
-#define BANS_HEAD_LEN		13
+#define BANS_HEAD_LEN		16
 
 #define BANS_FLAG_REQ		(1<<0)
 #define BANS_FLAG_OBJ		(1<<1)
@@ -514,6 +514,7 @@ BAN_Insert(struct ban *b)
 		return (ban_ins_error(NULL));
 	}
 
+	memset(b->spec, 0, BANS_HEAD_LEN);
 	t0 = VTIM_real();
 	memcpy(b->spec + BANS_TIMESTAMP, &t0, sizeof t0);
 	b->spec[BANS_FLAGS] = b->flags & 0xff;
@@ -832,7 +833,7 @@ ban_evaluate(struct worker *wrk, const uint8_t *bs, struct objcore *oc,
 	const char *arg1;
 
 	be = bs + ban_len(bs);
-	bs += 13;
+	bs += BANS_HEAD_LEN;
 	while (bs < be) {
 		(*tests)++;
 		ban_iter(&bs, &bt);



More information about the varnish-commit mailing list