return old;
}
-/* Inserts 'rule' into 'cls'. Transfers ownership of 'rule' to 'cls'.
- *
- * 'rule' must be an exact-match rule (rule->wc.wildcards must be 0) and 'cls'
- * must not contain any rule with an identical key. */
-void
-classifier_insert_exact(struct classifier *cls, struct cls_rule *rule)
-{
- hmap_insert(&cls->exact_table, &rule->node.hmap,
- flow_hash(&rule->flow, 0));
- cls->n_rules++;
-}
-
/* Removes 'rule' from 'cls'. It is caller's responsibility to free 'rule', if
* this is desirable. */
void
COVERAGE_INC(ofproto_subrule_create);
cls_rule_from_flow(flow, 0, (rule->cr.priority <= UINT16_MAX ? UINT16_MAX
: rule->cr.priority), &subrule->cr);
- classifier_insert_exact(&ofproto->cls, &subrule->cr);
+
+ if (classifier_insert(&ofproto->cls, &subrule->cr)) {
+ /* Can't happen, */
+ NOT_REACHED();
+ }
return subrule;
}
tcls_init(&tcls);
tcls_rule = tcls_insert(&tcls, rule);
- if (wc_fields) {
- assert(!classifier_insert(&cls, &rule->cls_rule));
- } else {
- classifier_insert_exact(&cls, &rule->cls_rule);
- }
+ assert(!classifier_insert(&cls, &rule->cls_rule));
check_tables(&cls, 1, 1, 1);
compare_classifiers(&cls, &tcls);