if (enumerator->string)
free(enumerator->string);
+ // Free network search
+ free(enumerator->networks_visited);
+
free(enumerator);
}
continue;
}
+ // Mark the bits on the path correctly
in6_addr_set_bit(&e->network_address,
(node->depth > 0) ? node->depth - 1 : 0, node->i);
- //for (unsigned int i = stack->depth + 1; i < 128; i++)
- // in6_addr_set_bit(&e->network_address, i, 0);
-
DEBUG(e->ctx, "Looking at node %jd\n", node->offset);
e->networks_visited[node->offset]++;
}
// Reached the end of the search
- // TODO cleanup
+
+ // Mark all nodes as non-visited
+ for (unsigned int i = 0; i < e->db->network_nodes_count; i++)
+ e->networks_visited[i] = 0;
return 0;
}