Introduce sparse flows and masks, to reduce memory usage and improve speed.
[sliver-openvswitch.git] / utilities / ovs-ofctl.c
index c7069c5..5f61fd6 100644 (file)
@@ -1778,6 +1778,7 @@ fte_free(struct fte *fte)
     if (fte) {
         fte_version_free(fte->versions[0]);
         fte_version_free(fte->versions[1]);
+        cls_rule_destroy(&fte->rule);
         free(fte);
     }
 }
@@ -1816,6 +1817,7 @@ fte_insert(struct classifier *cls, const struct match *match,
     if (old) {
         fte_version_free(old->versions[index]);
         fte->versions[!index] = old->versions[!index];
+        cls_rule_destroy(&old->rule);
         free(old);
     }
 }
@@ -1967,7 +1969,7 @@ fte_make_flow_mod(const struct fte *fte, int index, uint16_t command,
     struct ofputil_flow_mod fm;
     struct ofpbuf *ofm;
 
-    fm.match = fte->rule.match;
+    minimatch_expand(&fte->rule.match, &fm.match);
     fm.priority = fte->rule.priority;
     fm.cookie = htonll(0);
     fm.cookie_mask = htonll(0);