}
static void
-rule_update(struct ofproto *p, struct rule *rule)
+rule_update_actions(struct ofproto *ofproto, struct rule *rule)
{
+ bool actions_changed = rule_make_actions(ofproto, rule, NULL);
if (rule->may_install) {
if (rule->installed) {
- dpif_flow_set_actions(&p->dpif, &rule->cr.flow,
- rule->odp_actions, rule->n_odp_actions);
+ if (actions_changed) {
+ dpif_flow_set_actions(&ofproto->dpif, &rule->cr.flow,
+ rule->odp_actions, rule->n_odp_actions);
+ }
} else {
- rule_install(p, rule, NULL);
+ rule_install(ofproto, rule, NULL);
}
} else {
- rule_uninstall(p, rule);
+ rule_uninstall(ofproto, rule);
}
}
if (rule->cr.wc.wildcards) {
p->need_revalidate = true;
} else {
- if (rule_make_actions(p, rule, NULL)) {
- rule_update(p, rule);
- } else if (rule->installed && !rule->may_install) {
- rule_uninstall(p, rule);
- }
+ rule_update_actions(p, rule);
}
}
}
}
- if (rule_make_actions(p, rule, NULL)) {
- rule_update(p, rule);
- } else if (rule->installed && !rule->may_install) {
- rule_uninstall(p, rule);
- }
+ rule_update_actions(p, rule);
return true;
}