secchan: Force revalidation in ofproto_add_flow(), ofproto_delete_flow().
authorBen Pfaff <blp@nicira.com>
Thu, 19 Mar 2009 20:50:06 +0000 (13:50 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 19 Mar 2009 20:50:06 +0000 (13:50 -0700)
This code needs to have flows be revalidated if the rule includes
wildcards, just like add_flow() and modify_flow().

secchan/ofproto.c

index 8a2b774101dec87c5717a05d1fcfea71fe249c4d..3d69479b6658bceecd7f5c0ab2fc40675f59bd97 100644 (file)
@@ -971,7 +971,6 @@ ofproto_add_flow(struct ofproto *p,
 
     displaced_rule = rule_from_cls_rule(classifier_insert(&p->cls, &rule->cr));
     if (displaced_rule) {
-        /* XXX */
         rule_destroy(displaced_rule);
     }
 
@@ -986,6 +985,9 @@ ofproto_add_flow(struct ofproto *p,
         rule_install(p, rule, NULL);
     } else {
         assert(!packet);
+
+        /* We might need to change the rules for arbitrary subrules. */
+        p->need_revalidate = true;
     }
 }
 
@@ -999,6 +1001,9 @@ ofproto_delete_flow(struct ofproto *ofproto, const flow_t *flow,
                                                            flow, wildcards,
                                                            priority));
     if (rule) {
+        if (rule->cr.wc.wildcards) {
+            ofproto->need_revalidate = true;
+        }
         classifier_remove(&ofproto->cls, &rule->cr);
         rule_destroy(rule);
     }