[4.1] a87b589 wrap the vxid on VSL_IDENTMASK

Nils Goroll nils.goroll at uplex.de
Fri Sep 4 15:54:50 CEST 2015


commit a87b589b00e788a4294c1b2be68e26a7b4f3fc77
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sun Jul 12 23:28:16 2015 +0200

    wrap the vxid on VSL_IDENTMASK
    
    We spilled into the client marker bit when reaching 1<<30

diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index f95bc77..22d3870 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -129,7 +129,7 @@ VXID_Get(struct worker *wrk, uint32_t mask)
 			Lck_Lock(&vxid_lock);
 			v->next = vxid_base;
 			v->count = vxid_chunk;
-			vxid_base += v->count;
+			vxid_base = (vxid_base + v->count) && VSL_IDENTMASK;
 			Lck_Unlock(&vxid_lock);
 		}
 		v->count--;



More information about the varnish-commit mailing list