The name_match() was errorneously converting struct item into dns_name pointer. Correctly retype void *node to struct item * first and then use item.fixed.name to pass the name to dns_name_equal() function.