void standard_table_remove(standard_flow_table table, standard_flow *flow) {
key_flow key;
uint32_t hash;
- standard_flow *current, *prev;
assert(flow);
/* It's the head of the hash list. */
table->flows[hash] = flow->nexth;
} else {
+ standard_flow *current, *prev;
+
prev = table->flows[hash];
- current = table->flows[hash]->nexth;
- while (current != NULL) {
+ for (current = table->flows[hash]->nexth; current; current = current->nexth) {
if (current == flow) {
prev->nexth = flow->nexth;
break;
} else {
prev = current;
- current = current->next;
}
}
- //assert(current != NULL);
if (current == NULL) {
- printlog(LOG_DEBUG, "Flow %p disappeared?\n", flow);
+ printlog(LOG_CRITICAL, "Flow %p disappeared?\n", flow);
}
+ assert(current != NULL);
}
/* Remove the flow from the linked list. */