secchan: Initialize odp_flow members in other places that they were missed.
authorBen Pfaff <blp@nicira.com>
Thu, 5 Mar 2009 21:57:17 +0000 (13:57 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 5 Mar 2009 21:57:17 +0000 (13:57 -0800)
This might fix more memory corruption of the same form as commit 60822fb1,
"secchan: Fix random memory corruption due to uninitialized pointer."

secchan/ofproto.c

index 367943586208de3a5b65e72a563138227159d964..906a6a5e656cc44f7ecb132244ea4652ec4c85f2 100644 (file)
@@ -2192,6 +2192,8 @@ modify_flow(struct ofproto *p, const struct ofp_flow_mod *ofm,
         if (!rule->cr.wc.wildcards) {
             struct odp_flow odp_flow;
             flow_from_match(&odp_flow.key, NULL, &ofm->match);
+            odp_flow.actions = NULL;
+            odp_flow.n_actions = 0;
             dpif_flow_del(&p->dpif, &odp_flow);
         }
         classifier_remove(&p->cls, &rule->cr);
@@ -2673,6 +2675,8 @@ expire_rule(struct cls_rule *cls_rule, void *p_)
                                 struct rule, list, &rule->list) {
                 struct odp_flow odp_flow;
                 odp_flow.key = subrule->cr.flow;
+                odp_flow.actions = NULL;
+                odp_flow.n_actions = 0;
                 if (!dpif_flow_del(&p->dpif, &odp_flow)) {
                     update_stats(rule, &odp_flow.stats);
                 }
@@ -2683,6 +2687,8 @@ expire_rule(struct cls_rule *cls_rule, void *p_)
             struct odp_flow odp_flow;
             memset(&odp_flow, 0, sizeof odp_flow);
             odp_flow.key = rule->cr.flow;
+            odp_flow.actions = NULL;
+            odp_flow.n_actions = 0;
             dpif_flow_del(&p->dpif, &odp_flow);
         }
     }