[master] e6b61f5 Fix test for duplicate links in vsl_dispatch

Martin Blix Grydeland martin at varnish-software.com
Fri Sep 30 15:27:04 CEST 2016


commit e6b61f5b908ad1f53363ab79fca9131a92b54c54
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri Sep 30 15:21:13 2016 +0200

    Fix test for duplicate links in vsl_dispatch
    
    This test wasn't working as it was supposed to, and would cause the
    forward links graph building of log transactions to fail. The fail was
    soft, as the reverse mapping still succeeded creating the right
    mapping.
    
    Depending on when the local thread log buffer was flushed, the problem
    would show as spurious "duplicate link" log records to be inserted.
    
    Fixes: #1830

diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 16a575f..57a416a 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -830,7 +830,7 @@ vtx_scan_link(struct VSLQ *vslq, struct vtx *vtx, const uint32_t *ptr)
 	if (c_vtx->parent == vtx)
 		/* Link already exists */
 		return (0);
-	if (c_vtx->parent != vtx)
+	if (c_vtx->parent != NULL && c_vtx->parent != vtx)
 		return (vtx_diag_tag(vtx, ptr, "duplicate link"));
 	if (c_vtx->flags & VTX_F_COMPLETE)
 		return (vtx_diag_tag(vtx, ptr, "link too late"));



More information about the varnish-commit mailing list