if (command == OFPFC_DELETE) {
rule_remove(p, rule);
} else {
+ size_t actions_len = n_actions * sizeof *rule->actions;
+
+ if (n_actions == rule->n_actions
+ && !memcmp(ofm->actions, rule->actions, actions_len))
+ {
+ return 0;
+ }
+
free(rule->actions);
- rule->actions = xmemdup(ofm->actions,
- n_actions * sizeof *rule->actions);
+ rule->actions = xmemdup(ofm->actions, actions_len);
rule->n_actions = n_actions;
if (rule->cr.wc.wildcards) {