struct rule *rule;
int error;
- /* Check for overlap, if requested. */
- if (fm->flags & OFPFF_CHECK_OVERLAP) {
- struct classifier *cls;
-
- FOR_EACH_MATCHING_TABLE (cls, fm->table_id, ofproto) {
- if (classifier_rule_overlaps(cls, &fm->cr)) {
- return ofp_mkerr(OFPET_FLOW_MOD_FAILED, OFPFMFC_OVERLAP);
- }
- }
- }
-
/* Pick table. */
if (fm->table_id == 0xff) {
uint8_t table_id;
return ofp_mkerr_nicira(OFPET_FLOW_MOD_FAILED, NXFMFC_BAD_TABLE_ID);
}
+ /* Check for overlap, if requested. */
+ if (fm->flags & OFPFF_CHECK_OVERLAP
+ && classifier_rule_overlaps(table, &fm->cr)) {
+ return ofp_mkerr(OFPET_FLOW_MOD_FAILED, OFPFMFC_OVERLAP);
+ }
+
/* Serialize against pending deletion. */
if (is_flow_deletion_pending(ofproto, &fm->cr, table - ofproto->tables)) {
return OFPROTO_POSTPONE;