secchan: Fix segfault when subrules are invalidated.
authorBen Pfaff <blp@nicira.com>
Wed, 4 Mar 2009 22:55:20 +0000 (14:55 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 4 Mar 2009 22:55:20 +0000 (14:55 -0800)
The subrules were being freed, but not removed from the classifier, so a
segfault would occur later when they were accessed during a lookup or
traversal.

Thanks to Dan and Natasha for the report and testcases.

secchan/ofproto.c

index 6b03b1dd250e713081593516df539efeb86a0be1..1a3b4e8c952c1bc2cc6da372faa1ac390bf10feb 100644 (file)
@@ -2298,6 +2298,7 @@ revalidate_subrule(struct ofproto *p, struct rule *sub)
             struct odp_flow odp_flow;
             odp_flow.key = sub->cr.flow;
             dpif_flow_del(&p->dpif, &odp_flow);
+            classifier_remove(&p->cls, &sub->cr);
             rule_destroy(sub);
             return false;
         } else {