[4.0] 171f3ac wrap the vxid on VSL_IDENTMASK

Nils Goroll nils.goroll at uplex.de
Mon Jul 13 16:56:07 CEST 2015


commit 171f3ac585f2bda639f526c31ad0689aecb8f8b4
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Jul 13 16:51:30 2015 +0200

    wrap the vxid on VSL_IDENTMASK
    
    We spilled into the client marker bit when reaching 1<<30
    
    Master commits:
    a87b589b00e788a4294c1b2be68e26a7b4f3fc77
    0dd8c0b864a9574df0f2891824b4581d0e846613

diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index bfa2619..4781f9c 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -123,7 +123,7 @@ VXID_Get(struct vxid_pool *v)
 			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